Sign in to follow this  
SypheriaChronicles

Moving the world

Recommended Posts

I would move the camera instead, because you tend to have various objects in the world and it would increase the number of calculations you'd have to do if you moved the whole world... If you move the camera you'll only be calculating it's position.

Share this post


Link to post
Share on other sites
When a scene with N world objects (i.e. objects w/ co-ordinate frames related to the global frame) is rendered, then the model-to-view transformations (using row vectors)
Mi * V for all 0 <= i < N
are computed.

With the equivalence
V == C-1
of the view transformation and the camera transformation, it appears that changing the camera by D
C' := C * D
yields in a new view transformation
V' := D-1 * C-1 = D-1 * V

Substituting V with V' yields in
Mi * ( D-1 * V )
what means that a single matrix product does the job.

Since the paranthesis play mathematically no role, we can interpret the formula also as
== ( Mi * D-1 ) * V
and hence compute new model matrices
M'i := Mi * D-1 for all 0 <= i < N
what defines the same behaviour as above but by transforming the world instead of the camera. It means obviously to compute N matrix products.

Hence the effect is the same either, but the costs may differ drastically. So all answers above are correct, but partly ignore that additional costs should not be accepted if avoidable, IMHO.

Share this post


Link to post
Share on other sites
What I meant by my earlier comment is that while conceptually you are moving the camera, you are actually moving the world.

Most 3D API's, including D3D, don't allow you to "move" the camera - it's always fixed at the origin looking down the Z axis. Hence, to "move" the camera you use a global matrix to move the world in the opposite direction.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hodgman
What I meant by my earlier comment is that while conceptually you are moving the camera, you are actually moving the world.

Most 3D API's, including D3D, don't allow you to "move" the camera - it's always fixed at the origin looking down the Z axis. Hence, to "move" the camera you use a global matrix to move the world in the opposite direction.

For the case you're aiming at me: I know what you meant, and I haven't contradicted your comment in any way.

But interestingly enough, IMHO the reasoning of your objection is questionable. Maybe I'm wrong here, but when being rigorous I think there is no "actually", neither on the world nor on the camera side. Since
M * ( D-1 * V ) == ( M * D-1 ) * V
why should the RHS be superior (say, "more actual") to the LHS?

You justify your meaning with the origin and orientation of the camera. However, if you do so you imply that you interpret the result of the global-to-view transformation still in the global space. Now, someone else can say that s/he interprets the result of the same global-to-view transformation in the view space. Hence your justification doesn't hold w.r.t. to her/his reasoning.

So, IMHO its just a question of how things are interpreted. I personally prefer to consider reference frames, and to distinguish between inter- and intra-frame transformations, simply because of e.g. FK and other everyday mechanisms. But because I'm not a mathematician, I may miss something here.

Share this post


Link to post
Share on other sites

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