Recent

Author Topic: Homography & affine transformations  (Read 13748 times)

EmperorOfKeyboard

  • New Member
  • *
  • Posts: 29
  • That is why people who are afraid to look inside t
Homography & affine transformations
« on: December 20, 2021, 03:52:16 am »
I want make extrasuper arcade game, so decided use spirits. Then as geniuse I decided make own engine, no, The Engine!!!! of it. So can you recommend anything to read about how from rectangular bitmap make trapezium and... oblique trapezium.
I think, can find rotation formulas easily. It's something about sicus and nonseus of angle..... x=x0*sincos, y=y0*-cossin or vice verza...
How aprox it should be shown on pic.
Mathematical words I took from wikipetia. I bad with english.
I so smart almos smart as you, but i also cute.

Seenkao

  • Sr. Member
  • ****
  • Posts: 409
    • New ZenGL.
Re: Homography & affine transformations
« Reply #1 on: December 20, 2021, 03:58:52 am »
Я думаю достаточно немало литературы, описывающей всё что вы хотите сделать вручную. Вам надо искать литературу в основном 1990-х - 2010-х годов.
(какой ваш родной язык?)

Eng: I think there is quite a lot of literature describing everything that you want to do manually. You should be looking for literature mainly from the 1990s - 2010s.
(what is your native language?)
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

EmperorOfKeyboard

  • New Member
  • *
  • Posts: 29
  • That is why people who are afraid to look inside t
Re: Homography & affine transformations
« Reply #2 on: December 20, 2021, 04:09:39 am »
Россиянский язык есть моя родной, как я всегда говорить, хотя я умею эрративы. Нимношк.

Дело в том, что я точно помню, что видел эти преобразования в книжке конца 80-х, но не помню, как она называлась. Там было и про двухмерную, и про трёхмерную графику. Составлялись фигуры из примитивов, рисовались мощнейшие кружки и собаки с помощью обратной трассировки. Ещё помню там были то ли самолётики, то ли космолётики.

Rissinian language are my nativest, as i say always, and I can erratives. Tiny.

BTW, i exactly remembering that 've seen this transitions before in book of late 80's, but cannot recall its name. There were and about 2D and about 3D graphics. Were made complex figures from primitives, were drawn powerful mugs and dogs with reversed ray tracing.
Also remember there were small planes or spaceships.
I so smart almos smart as you, but i also cute.

Seenkao

  • Sr. Member
  • ****
  • Posts: 409
    • New ZenGL.
Re: Homography & affine transformations
« Reply #3 on: December 20, 2021, 04:26:22 am »
Думаю на форуме gamedev лучше поспрашивать. У меня на руках есть книжка, но там код паскаля достаточно "древний". Точнее его ещё перерабатывать надо.
"Иванов, Батраков. Трёхмерная компьютерная графика. 1995"

Но там вроде нет сложных объектов. Посмотри.

Eng: I think it is better to ask around on the forum gamedev. I have a book in my hands, but there the Pascal code is quite "ancient". More precisely, it still needs to be processed.
"Ivanov, Batrakov. Three-dimensional computer graphics. 1995"

But there seems to be no complex objects. Look.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

Handoko

  • Hero Member
  • *****
  • Posts: 4677
  • My goal: build my own game engine using Lazarus
Re: Homography & affine transformations
« Reply #4 on: December 20, 2021, 04:32:35 am »
@EmperorOfKeyboard

What graphics library did you use? I am currently learning OpenGL and building my own engine. Previously I used TCanvas, it worked and already supported z-transparent mouse click selection, etc. Unfortunately it run slowly if there were too many sprites. So I decided to rewrite it to use OpenGL.

So I just want to warn you, if you do not use hardware accelerated graphics library, soon you will have performance issue. What you want to do seems can be easily done using OpenGL.

EmperorOfKeyboard

  • New Member
  • *
  • Posts: 29
  • That is why people who are afraid to look inside t
Re: Homography & affine transformations
« Reply #5 on: December 20, 2021, 04:48:16 am »
I agree with both. Think, first i need to understand maths, and only then start to learn which Opengls may help.
I so smart almos smart as you, but i also cute.

Handoko

  • Hero Member
  • *****
  • Posts: 4677
  • My goal: build my own game engine using Lazarus
Re: Homography & affine transformations
« Reply #6 on: December 20, 2021, 04:53:59 am »
Not fully correct. I've got A+ in geometry but weak in trigonometry and matrix because they were barely taught at my school. My progress of learning OpenGL is slow. I would say to be able to better understand OpenGL, you only need basic math but good in matrix.
« Last Edit: December 20, 2021, 04:57:33 am by Handoko »

EmperorOfKeyboard

  • New Member
  • *
  • Posts: 29
  • That is why people who are afraid to look inside t
Re: Homography & affine transformations
« Reply #7 on: December 20, 2021, 05:12:12 am »
Not fully correct. I've got A+ in geometry but weak in trigonometry and matrix because they were barely taught at my school. My progress of learning OpenGL is slow. I would say to be able to better understand OpenGL, you only need basic math but good in matrix.
You not need to know martix, it's almost usual variables, computer already taught what to do, you just need to determine why it should be done. I dont know why columns must be multplied on rows, i only know that if some special way you'll get 1/A matrice for linear system with A coef martice, you can get all X's by multplying. Only thing I know from linear algebr. *ROFL*
I so smart almos smart as you, but i also cute.

Seenkao

  • Sr. Member
  • ****
  • Posts: 409
    • New ZenGL.
Re: Homography & affine transformations
« Reply #8 on: December 20, 2021, 05:13:36 am »
Можно взять простые движки, которые достаточно быстро выводят примитивы. И движки, которые не заставляют разбираться с созданием окна вывода графики.
Можно в Lazarus напрямую использовать OpenGLContext, достаточно его просто установить. Но надо разбираться с командами со всеми.
Если программируешь на Windows, то есть несколько графических библиотек, и для Windows проще, в большинстве своём они там работают.
здесь
тут посмотреть.

GLScene, GLEngine2D, AsphyreSphinx, BlackShark, glRender, PGD.

Посоветовать что-то не могу, потому что большинство из них меня не зацепили, а с тем с которым работаю, он пока только для 2D. Я не знаю какой из них проще в изучении. Наверно тот, что имеет достаточно немало примеров. Так же есть много книг, в том числе и на русском по OpenGL, и зачастую там расписаны формулы по

А если вообще не заморачиваться, то можно в буфер выводить изображение, а потом буфер перекидывать на канву. ))) Но всё равно столкнёшься с проблемой вывода, когда достаточно сложноватое приложение делать будешь.

Google translate:
You can take simple engines that quickly render primitives. And engines that do not force you to deal with the creation of the graphics output window.
You can use OpenGLContext directly in Lazarus, just install it. But we need to deal with the teams with everyone.
If you program on Windows, then there are several graphic libraries, and for Windows it is easier, for the most part they work there.
here
look here.

GLScene, GLEngine2D, AsphyreSphinx, BlackShark, glRender, PGD.

I cannot advise anything, because most of them did not hook me, and with the one I work with, it is still only for 2D. I don't know which one is easier to learn. Probably the one that has quite a few examples. There are also many books, including in Russian, on OpenGL, and often formulas with examples are described there.

And if you don't bother at all, you can output an image to the buffer, and then throw the buffer onto the canvas. ))) But you will still face the problem of output when you make a rather complicated application.

Может не надо ни чего изобретать, а просто взять полноценный движок, который уже всё делает?  :) Castle Game Engine например.

Eng: Maybe you don't need to invent anything, but just take a full-fledged engine that already does everything? :) Castle Game Engine for example.
« Last Edit: December 20, 2021, 05:16:55 am by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

EmperorOfKeyboard

  • New Member
  • *
  • Posts: 29
  • That is why people who are afraid to look inside t
Re: Homography & affine transformations
« Reply #9 on: December 20, 2021, 05:24:20 am »
WOW! *YAHOO*
What can do a short sleep!
I instantly found some interesting! Like a start.
https://www.cs.cornell.edu/courses/cs3152/2013sp/lectures/15-Perspective.pdf
Of certainly if I'll try harder, will find more and detailed bigger (smaller).
« Last Edit: December 20, 2021, 11:22:43 am by EmperorOfKeyboard »
I so smart almos smart as you, but i also cute.

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1034
Re: Homography & affine transformations
« Reply #10 on: December 20, 2021, 02:56:14 pm »
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.

EmperorOfKeyboard

  • New Member
  • *
  • Posts: 29
  • That is why people who are afraid to look inside t
Re: Homography & affine transformations
« Reply #11 on: December 21, 2021, 01:49:38 am »
It will either be simple or slow.
Why not BOTH?! I'm master of doing uneffectively!

Thank you for link though, there's manual.
I so smart almos smart as you, but i also cute.

Seenkao

  • Sr. Member
  • ****
  • Posts: 409
    • New ZenGL.
Re: Homography & affine transformations
« Reply #12 on: December 21, 2021, 11:10:25 am »
Думаю тебе стоит пробежаться по "устаревшему" 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.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

EmperorOfKeyboard

  • New Member
  • *
  • Posts: 29
  • That is why people who are afraid to look inside t
Re: Homography & affine transformations
« Reply #13 on: December 21, 2021, 12:02:31 pm »
Пожалуй, займусь. Выглядит многообещающе.
I so smart almos smart as you, but i also cute.

PascalDragon

  • Hero Member
  • *****
  • Posts: 4266
  • Compiler Developer
Re: Homography & affine transformations
« Reply #14 on: December 21, 2021, 01:30:23 pm »
Пожалуй, займусь. Выглядит многообещающе.

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

 

TinyPortal © 2005-2018