Skip to content

Conversation

@xdanca01
Copy link

Nejdříve se musí provést depth mapping a až teprve můžeme provést perspective division. Je to napsáno i v citaci: http://learnwebgl.brown37.net/08_projections/projections_perspective.html

Translate the apex of the frustum to the origin. (Yellow matrix)
Scale the depth values (z) into a normalized range (-1,+1) (and setup for division by (-z)). (Purple matrix)
Perform the perspective calculation. (Gray matrix)
Scale the 2D (x’,y’) values in the viewing window to a 2-by-2 unit square; (-1,-1) to (+1,+1). (Cyan matrix)

Nejdříve se musí provést depth mapping a až teprve můžeme provést perspective division. Je to napsáno i v citaci: http://learnwebgl.brown37.net/08_projections/projections_perspective.html


    Translate the apex of the frustum to the origin. (Yellow matrix)
    Scale the depth values (z) into a normalized range (-1,+1) (and setup for division by (-z)). (Purple matrix)
    Perform the perspective calculation. (Gray matrix)
    Scale the 2D (x’,y’) values in the viewing window to a 2-by-2 unit square; (-1,-1) to (+1,+1). (Cyan matrix)
@cafour
Copy link
Owner

cafour commented Jun 15, 2024

No jo, jenže ten samý článek má o kus výše:

1. Translate the apex of the frustum to the origin.
2. Perform the perspective calculation.
3. Scale the 2D (x’,y’) values in the viewing window to a 2-by-2 unit square: (-1,-1) to (+1,+1).
4. Scale the depth values (z) into a normalized range (-1,+1).
5. Flip the orientation of the z axis to match the clipping volume’s orientation.

Je možné, že výsledek vyjde stejně, ať je ta matice na kterémkoli z těch dvou míst. Checknu to za pár dní, až mě nebude pálit deadline, a pokud máš pravdu, a M_{depth} fakt musí být už druhá, tak tohle PR mergnu.

Každopádně díky za PRko! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants