Advertisement Jump to content
Sign in to follow this  
noatom

World space or projection?

This topic is 1876 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

Suppose I have a camera which has it's own viewmatrix that represents it. If I were to multiply the viewmatrix with the projection matrix,the camera goes into world space.

 

My question is: why does it go into world space,and not into projection space?

Share this post


Link to post
Share on other sites
Advertisement

If you multiply view matrix with projection matrix, you'll get a matrix which can be used to transform from world space to projection space (assuming that your matrices are constructed correctly and that the order of matrix multiplication is correct). 

 

However, the typical camera/view matrix is a matrix which transforms from world space to view space. For that reason typically you'll see some fancy math at the construction of a view matrix (ie. matrix inverse).

 

Cheers!

Share this post


Link to post
Share on other sites

I still don't get it. You have a model in world space.But how can you compare world space data to view * proj space extracted planes?!

Share this post


Link to post
Share on other sites

Well, you can't since those those things are in different spaces. (Practically, you can but you won't get anything useful out of it).

 

So, to get something out of this, you'll need transform either to the other's space. 

 

In my opinion it is faster to transform the frustum planes of a camera to the world space to perform frustum culling (for example). So if your frustum planes are in projection space, you'll need to transform them by inverse view-projection matrix. Of course, it might be easy to construct the planes directly in world space too. 

 

Cheers!

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!