#### Archived

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

# Super basic newbie transform question....

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

## 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 on other sites
is my camera upside down? or inside out?

if (0,1,0) is the default "up" why when i transform by (0,1,0) i move down???

*bump*

thanks

##### 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 on other sites
this ain''t open gl... i have a world transform... i leave that alone and just change the VIEW transform.

##### Share on other sites
i thought view=camera & world=world

##### 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 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 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 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?

##### 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]

1. 1
Rutin
31
2. 2
3. 3
4. 4
5. 5

• 12
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633314
• Total Posts
3011323
• ### Who's Online (See full list)

There are no registered users currently online

×