T
T
Type Programmer2018-07-11 17:51:23
assembler
Type Programmer, 2018-07-11 17:51:23

Assembler, graphics, how to make a distance effect, an algorithm for reducing (enlarging) an image?

I want to make a very simple 3d "scene", actually 2d. Something in the style of the game of doom. I don't plan to do anything, no floor textures, no sky, no nothing. Only the stage has a one-color floor, the ability to move and some kind of sprite on the stage.
(I use only BIOS interrupts, video mode 320x200, 256 colors from INT 10h)
For a 3D effect, the further the sprite, the smaller it seemed. What algorithm can make a sprite smaller.
Options came to my mind while:
- Make a small but high-quality sprite that, if necessary, will be made larger. That is, the closer the object, the more it will need to be increased, and the quality will be lost, but still. (Although for a short distance you can try to use another sprite (but I'm not sure if this option is good))
- Make a big sprite that will decrease (here I don’t even understand how to adequately compress it, everything that comes to my mind is complicated and crooked, for example One pixel should contain the colors of its neighbors, firstly I don’t know how to implement it, secondly, what if there will be one black pixel and a lot of white around it, which will eventually turn out. It will just disappear)
What do you think, which method is better to use, what difficulties I did not take into account, or maybe you know others?
PS: Not very strong in programming, everything is purely for fun.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2018-07-11
@MegaCraZy6

You are digging too big. But first you can start googling

  • perspective
  • camera transformation matrix
  • image level of details

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question