Forum > Graphics

Homography & affine transformations

<< < (3/5) > >>

What you want to do is paint the sprite on a surface. It's called texturing and the bitmaps are called textures.

The simplest way to do that is to use OpenGL. Set up a viewport (many examples) and create a rectangle. Tell OpenGL that it needs to texture it with your sprite. (Important: normally the front of the rectangle is where the corners are inserted counter clockwise.) Most of the calculations are then done by OpenGL.

If you want to do it yourself, check out Wolfenstein 3D en DOOM, from iD Software. There are many examples that explain how they work. And the code is Open Source. But keep in mind, that computers have GPUs that are many thousands of times faster in doing that than the CPU. It will either be simple or slow.

As for an example, you can look at the Castle Game Engine.


--- Quote from: SymbolicFrank on December 20, 2021, 02:56:14 pm ---It will either be simple or slow.
--- End quote ---
Why not BOTH?! I'm master of doing uneffectively!

Thank you for link though, there's manual.

Думаю тебе стоит пробежаться по "устаревшему" OpenGL. И выводить примитивы с его помощью. Заодно сможешь собрать для себя определённые процедуры для вывода примитивов.

Или можешь взять GLEngine2D и переделать оттуда примитивы в трёхмерные. А этот движок как раз с примерами идёт. Для начала можно использовать только 2D.

Google translate: I think you should go over the "legacy" OpenGL. And display primitives with it. At the same time, you can collect for yourself certain procedures for the output of primitives.

Or you can take GLEngine2D and convert the primitives from there into three-dimensional. And this engine comes with examples. For starters, you can only use 2D.

Пожалуй, займусь. Выглядит многообещающе.


--- Quote from: EmperorOfKeyboard on December 21, 2021, 12:02:31 pm ---Пожалуй, займусь. Выглядит многообещающе.

--- End quote ---

Please don't reply solely in a non-English language in the international part of the forum.


[0] Message Index

[#] Next page

[*] Previous page

Go to full version