Jump to content
  • Advertisement
Sign in to follow this  
zurekx

What happens when multiplying by projection matrix

This topic is 3746 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When a vertex i multiplied with the projectin matrix (and, of course, the model view matrix), what kind of points do I have? Are the points in the unit cube or what? Im talking about just multiplying with the projection matrix, not dividing with the w-coordinate or anything. Because Im trying to render a scene, where I set the color to the z-coordinate after multiplying with this matrix, and I get some strange results, the value doesnt seem to be in the range [-1, 1].

Share this post


Link to post
Share on other sites
Advertisement
if a Vertex is multiplied with the gl_(ModelView)ProjectionMatrix it is in a 4 dimensional unnamed space. After the dividing the XY and Z component by W the vertex is in postperspective space (range [-1.0.... 1.0] for XYZ if the vertex is located inside the frustum) This division (and the transformation into screenspace) is still part of the fixed pipline.

If you have calculate the vertex screen position in your program add that division after the matrixmultiplication.

Share this post


Link to post
Share on other sites
Thanks.. I just want to color the screen with the depth (im visualising a shadow map). Then, perhaps, I should just take the eyespace z-coordinate and divide by the depth of the far-plane? After I divide by w, isnt z allways 1?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!