Game Development Community

Asymetric camera frustum

by Tobias B. · in Torque 3D Professional · 06/19/2009 (1:01 am) · 1 replies

Hi,

presently, I'm playing around with the engine code. Since I'm still a game engine coding beginner, I have troubles to get one point: I'm trying to setup an asymmetric camera, allowing to see more to the right side than to the left side. As far as I got, this leads to modifying the camera frustum. Am I right? And where is the right point to start modifying the frustum? As far as I got it, I have to implement this in the engine source code itself - or is there a console function I have to call?

Thanks for helping an engine coding noob :-)

Tobias

#1
06/19/2009 (12:41 pm)
I haven't messed with this much, so this could be off. There exists frustum.cpp in /math/util/frustum.cpp. This appears to be able to do a lot of the math for different projection modes which would help you create your frustum.

I'm not sure if there is a script interface to controlling this, the SceneGraph performs a GFXDevice::getFrustum() and then creates a SceneState using this frustum. (SceneGraph::createBaseState() in /sceneGraph/sceneGraph.cpp)

Whole lot of hand off going on so I'm not certain at what level it would be best to set this. Not too familiar with the SceneGraph. GFXDevice:setFrustum() seems like the root of it all.

Hope i'm not guiding you down the wrong path, may be easier to do, if someone who knows more has an idea.