Sign in to follow this  

Transforming from world space to object?

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

This topic is 4594 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this