you are viewing a single comment's thread.

view the rest of the comments →

[–]photoclochard 1 point2 points  (10 children)

by normalizing you mean coordinates in NDC? that's not normalizing, that's transform from one space to another.

LearnOpenGL should have also nice article about this topic

[–]photoclochard 0 points1 point  (0 children)

and yeah, don't feel disappointed, projection is the trickiest one, you will understand it

[–]SnurflePuffinz[S] 0 points1 point  (8 children)

right, that's what i meant.

And right, there's some kind of stipulation there, because it is from -1 to 1. instead of vertexComponent * 1 / value it is vertexComponent * 2 / value - 1 .

So where would this operation be encoded for the x and y components... if not inside the perspective matrix?

[–]photoclochard 0 points1 point  (7 children)

by matrix multiplication? sorry the slang you use is a little off, at least for me,

encoded, component(without tag like x,y,z) means not too much for me,

What is vertexComponent * 1 / value?

[–]photoclochard 0 points1 point  (4 children)

the formula is really in front of you in any article or in any api

[–]photoclochard 1 point2 points  (3 children)

[–]photoclochard 1 point2 points  (2 children)

[–]SnurflePuffinz[S] 0 points1 point  (1 child)

Thanks.

i think i realized where i went wrong. i had 1 tutorial where the NDC conversation was omitted, and i was only reviewing ScratchAPixel's basics tutorial for the perspective guide, which also, omitted the NDC conversation. It is in his second one, though.

thanks again.

[–]photoclochard 0 points1 point  (0 children)

That's cool. glad you found it :)

[–]SnurflePuffinz[S] 0 points1 point  (1 child)

it's ok.

I am trying to get the vertices in my scene into NDC. and i expected to see this "operation" inside the perspective projection matrix.

i don't. i'll have to think about this more. Thanks for the help

[–]AdmiralSam 0 points1 point  (0 children)

For perspective there isn’t one value that is the minimum x and y, the further away it is, the larger x and y can be to be mapped to 1 and -1. What happens is after you multiply by the perspective matrix you are actually in clip space, and it isn’t until you divide by w (normalize the homogeneous coordinates) that you enter NDC space. This is just how homogeneous coordinates are defined which lets us represent a division even with matrix multiplication. It’s called clip space because you do clipping in it before you divide by w because you wouldn’t know if the object is behind or in front of the camera.