Archived

This topic is now archived and is closed to further replies.

Super basic newbie transform question....

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

myDevice.Transform.View *= Matrix.Translation(new Vector3 (0,-30,0)); moves the camera up instead of down? and to move in the direction of the camera i have to invert the new Vector3(view.M13, view.M23, view.M33) i get from the view matrix? i guess i am missing something really basic? is up down? did i ferget to invert my umm... duh

Share this post


Link to post
Share on other sites
Because you''re not actually transforming the camera. There is no camera, in DirectX/OpenGL. What you would consider the ''camera'' is really just a perspective division centered around the origin. Thus, what you''re really doing is moving the world around.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
this ain''t open gl... i have a world transform... i leave that alone and just change the VIEW transform.

Share this post


Link to post
Share on other sites
No. In the pipeline, the world and view matrices are just multiplied. They do the exact same thing, just in a different order.

If you don''t understand this, I suggest you read up on linear algebra and its uses in computer graphics.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
You''ll be doing yourself a favor by reading up on pipeline transformations. Particularly view and world transformations.

As it was stated, there really isn''t a camera. You''re simulating a camera by transforming the world. Think of it like this...

If you translate up, you are moving all the objects in the world up. So it would look like your camera moved down. To make it look like the camera is going up, you move all objects in the world down instead. Get it?

If this is all wacky (it is), try using an camera axis system with an eye point, lookat point, and up point. Then you can think more in terms of moving the camera instead of the world. Yeah, this stuff is crazy if you ask me. hah.

Share this post


Link to post
Share on other sites
quote:
Original post by drown
If this is all wacky (it is), try using an camera axis system with an eye point, lookat point, and up point. Then you can think more in terms of moving the camera instead of the world. Yeah, this stuff is crazy if you ask me. hah.
Even then, you will serve yourself very well if you take the time to figure out how lookAt matrices are calculated. Gramm-Schmidt orthonormalization plays a role.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
could anyone provide a quick explanation of what the difference it between world and view transforms then please?

from what i read here it seems like you are saying they should affect my scene in the same way?

i thought if i

myDevice.Transform.World *= Matrix.Transformation(0,0,-100);

would move the world back and the "camera"/view forward, and

myDevice.Transform.View *= Matrix.Transformation(0,0,-100);

would move the camera back and the world forward...

but you are saying both of those should move the camera forward?

please excuse my ignorance

Share this post


Link to post
Share on other sites
Of course they do. You've shown it yourself, in your original post.

EDIT: The REASON for having two separate matrices like this is that, in general, it is convenient to pretend that the camera may be manipulated independently of the world. You can screw with the world matrix all you want without having to deal with the view matrix. OpenGL accomplishes this by maintaining a matrix stack; directX does it by maintaining separate model and view matrices. I personally prefer the OGL way, since it's more flexible and doesn't impose an arbitrary methodology on the programmer....... but I digress.

How appropriate. You fight like a cow.

[edited by - sneftel on June 5, 2003 10:37:24 PM]

Share this post


Link to post
Share on other sites