🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Is it "normal" to move the world around the camera or the camera around the world?

Started by
5 comments, last by arrogantgod 24 years, 9 months ago
Hmm,
___I'd say move the camera. A lot less geometry work for the computer to do. The only thing is you might have to move the "sky" (or skybox) along with the camera (if there is a sky.)
Advertisement
I don't think it is possible to move the camera around the world. We only think of it that way, really you should have a "camera" and then just translate and rotate in the opposite direction, and orientation.
I do move the camera around the world currently. I just change its eye point and target point.

They are one and the same. The classic projection matrix and the one supported by 3D cards requires that the viewer is at the origin looking down z. (Positive or negative) Thus moving the camera is simply a way of describing the transformations required to place the geometry ready for projection. If you 'move the world' you are infact doing exactly the same as moving the camera! The trick is to do as much culling as possible in world space to minimize the geometry transformed into view space.

------------------
Cheers,
Martin

[This message has been edited by Martin (edited September 11, 1999).]

Cheers,MartinIf I've helped you, a rating++ would be appreciated
I would agree half and half to your question.

I would personally use a camera system that moves around the world. This is primarily used to be able to reject polygons that aren't in the viewing pyramid. This also speeds up your geometry transforming by only transforming required polygons. But using a camera system also in a way transforms your whole world for you (rejecting unseen polygons)

------------------
- Microwerx

- MicrowerxWebsite: http://www.geocities.com/
e-mail:[email=jmetzgar@mfactorgames.com]jmetzgar@mfactorgames.com[/email]
When the player transverses the world:

Should I apply a matrix to the world so that it moves?

Or, should I just move the camera around the world?

Thanks,
webmaster@arrogantgod.com

If I remember correctly, In my first D3D program I tried to move my camera around the world but it screwed up the Zbuffering and triangle culling. When I would move the camera forward (+Z) and turn around and look back the back sides of the objects wouldn't be drawn and what was drawn was not in the correct order. I probably was doing something wrong, but since then I move all the objects around the camera which is fixed. I accomplish this by having a virtual camera (its just another matrix) that I move around the world. Before I render each object I multiply the virtual camera matrix and the objects matrix together and set D3DTRANSFORMSTATE_WORLD to the result.

I cant see how my approach could screw up any type of fustrum clipping because instead of moving the camera to see the object I move the object into the cameras view. In the end the result is the same.

btw has anyone successfully used D3D Viewport ComputeSphereVisibility??


"You know you're obsessed with computer graphics when you're outside and you look up at the trees and think, "Wow! That's spectacular resolution!""

This topic is closed to new replies.

Advertisement