Jump to content
  • Advertisement
Sign in to follow this  
xsirxx

Transforming from world space to object?

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

Im currently working on trying to get MRTs working with deferred shading. And im having one hell of a time trying to get it working. I am using the samples from NVIDIA's website and I read on the fx files that their position is in object space? This is weird because I mul my position against the WorldViewProj matrix when my object is in World space and it always worked. Now im stuck with seeing it not work when trying to RenderToTarget, instead of to the back buffer. For deferred shading.. So my objects are not showing up and im passing to the vertex shader their world space. My question is, If I want to take their position from world space to object space, is there a simple matix to do that? Thanks much, Brad

Share this post


Link to post
Share on other sites
Advertisement
Well that is a start :).... Why would it be any different? of course that maybe a very stupid statement heh :) Hope thats it, thanks.

edit:

So InvModelView will take it from View space back to model space right? is model space the same as objectspace? my problem is i use world coordinates and dont use object coordinates, but this pixel shader is calling for object i believe? So i need to go from world, to object?

Share this post


Link to post
Share on other sites
I always find it helpful to give matrices more descriptive names that describe the spaces the matrices transform between, e.g.:

World == ObjectToWorld
View == WorldToCamera
Projection == CameraToClip

Then when you want to go from say world space to object space, what needs to be done is pretty intuitive: transform with the inverse of the ObjectToWorld matrix.

OpenGL concatenates the ObjectToWorld and WorldToCamera matrices into a single "ModelView" matrix; fixed function Direct3D stores them separately (D3DTS_WORLD and D3DTS_VIEW); with shaders of course, you're free to choose what matrices to store[smile]


Some spaces do have multiple names for (usually) the same thing:

Object space == Model space
Camera space == View space == Eye space
Clip space == Homogeneous clip space

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!