Forum > Graphics

Homography & affine transformations

<< < (4/5) > >>

EmperorOfKeyboard:
Maby I are doing somethink wrong, butt I cannot find download button. :(
Well, I can for separate files, byt there're hundreds! Not to mention folders structure.
Maby I need login GitBug?

Seenkao:
Ты в папку зашёл, выйди и скачай всю библиотеку. Да, забыл, она работает с Delphi, можно с Delphi 7.

Можешь попробовать ещё ZenGL. Просто я не знаю, насколько будет легко тебе с ним работать. Но примеры так же есть для работы с основными примитивами. Смотри пятую демку. А вообще можешь все демки посмотреть.  :) Работать будет и на Lazarus и даже на FPC отдельно (нужен опыт компилирования для FPC, новичкам проще в Lazarus компилировать).

Google translate: You went into the folder, go out and download the entire library. Yes, I forgot, it works with Delphi, you can with Delphi 7.

You can also try ZenGL. I just don't know how easy it will be for you to work with him. But there are also examples for working with basic primitives. See the fifth demo. In general, you can see everything. :) Will work on Lazarus and even on FPC separately (compilation experience for FPC is required).

circular:
It depends how low level you wanna go.

That can be done directly your program or using libraries. Nowadays most computer support OpenGL so you can get things very much accelerated.

Here are all the steps you need:
- have objects defined in a 3D world, each vertex as (x,y,z) coordinates
- rotate the world around the viewer (lots of sine and cosine or using normalization and vector product to compute all axes)
- projection in 2D : basically dividing horizontal and vertical coordinates by depth. Though it may not be trivial if the polygon is both in front and behind, like as wall on the side, because then you need to split it at a certain distance to avoid dividing by 0.
- filling the texture : this combines regular polygon filling but also interpolating 1/z to get a perspective transform.

If you use a 3D library, basically you only need to take care of defining the 3D objects and define the transform. Programming everything up to the pixels is feasible, I did it in BGRABitmap library, though software rendering is much slower than hardware.

Here is how for example a class that computes a scene (rotating and projecting):
https://github.com/bgrabitmap/bgrabitmap/blob/master/bgrabitmap/bgrascene3d.pas

Here is an example on how to actually render the polygons (it uses software units):
https://github.com/bgrabitmap/bgrabitmap/blob/master/bgrabitmap/bgrarenderer3d.pas

And here using OpenGL (encapsulated in classes):
https://github.com/bgrabitmap/bgrabitmap/blob/master/bgrabitmap/bgraopengl3d.pas

Regards

EmperorOfKeyboard:
Seenkao, same.

circular, division by 0 only if character stands right on the wall, collision test must prevent it. Or mobsters who attack - they should never be placed in came coords as char. Of course char must have "standard" heigth, for what reason i dodnt decide. Maybe if character shall be have 0 height, then it may go throught wall, because walls must have heigth.... I didnt think. I want make somethink as SESMAR, but w/o that ill anime and with right angle. (Scr taken from https://www.polygon.com/2018/2/15/17012102/secret-of-mana-review-remake-ps4-vita-playstation-sony-pc-release-square-enix.)

Why I want own game? Reson is so simple that you'll no laugh because it's getting old (i dont know what that means, but its like "boring"?): i cannot win regular games! So if I'll make own, I be sure i can win or no one can win, haha. (Problem of such way be that no one except me shall want play such game. Too easy.)

circular:

--- Quote from: EmperorOfKeyboard on December 23, 2021, 01:50:54 pm ---circular, division by 0 only if character stands right on the wall, collision test must prevent it.
--- End quote ---
I think you missed the point. If there is anything behind you, like the floor or a wall on your left or right, then at some point, the z value is zero. This is generally solved by defining a clip plane, a minimum depth for drawing things. For example, in real life that could be everything at least 1 cm away.


--- Quote ---Why I want own game? Reson is so simple that you'll no laugh because it's getting old (i dont know what that means, but its like "boring"?): i cannot win regular games! So if I'll make own, I be sure i can win or no one can win, haha. (Problem of such way be that no one except me shall want play such game. Too easy.)

--- End quote ---
That's a good reason enough. You could also try on easy settings.  ;)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version