Tilting the camera / TGB Kart
by Chris Jorgensen · in Torque Game Builder · 07/29/2008 (11:15 pm) · 47 replies
I'd like to be able to tilt the camera such that a tile or sprite would be displayed at an angle. Here's a simulated effect:
I want to be able to all the normal things with the scene / objects... rotate the sprites, put layers of sprites, etc, etc.... just with the camera "tilted." I've been poking around in the code briefly and have stumbled across classes like t2dSceneWindow with the struct tCameraView, as well as t2dSceneObject, etc, etc.
So I have a few questions:
1- Where would I go to do this? Rotate the scene object or modify the camera view?
2- Within the selection from (1), what functions / parameters should I be looking at?
3- Are there any other modifications I'd need to do to get this to display correctly?
I'm hoping someone out there's knowledgeable in this stuff. I'm fairly raw on openGL, etc, so any pointers would be great!
I want to be able to all the normal things with the scene / objects... rotate the sprites, put layers of sprites, etc, etc.... just with the camera "tilted." I've been poking around in the code briefly and have stumbled across classes like t2dSceneWindow with the struct tCameraView, as well as t2dSceneObject, etc, etc.
So I have a few questions:
1- Where would I go to do this? Rotate the scene object or modify the camera view?
2- Within the selection from (1), what functions / parameters should I be looking at?
3- Are there any other modifications I'd need to do to get this to display correctly?
I'm hoping someone out there's knowledgeable in this stuff. I'm fairly raw on openGL, etc, so any pointers would be great!
About the author
Owner of Cascadia Games LLC
#42
09/13/2008 (8:30 pm)
I'm trying to shoot a t2dShape3D (or any t2dSceneObject for that matter) into the vanishing point of the scene. But I am having some issues in the object actually getting smaller as it approaches that point. Has anybody either a) managed to manipulate the code to do so, and if so, please share; or b) have any suggestions on where I should go about looking to complete this myself? Cheers.
#43
I haven't poked into the 3D objects yet. What happens when you place a 3D object in a tilted scene? Does it look flat and tilted, or is it as if the tilt wasn't there?
09/14/2008 (12:25 am)
@Chad, yes. I've got it working where you can design the track in 2D, then play in 3D fairly easy now. See my blog post for an example.I haven't poked into the 3D objects yet. What happens when you place a 3D object in a tilted scene? Does it look flat and tilted, or is it as if the tilt wasn't there?
#44
09/14/2008 (10:42 am)
3D objects in a perspective scene look as though they are still flat. I experimented with t2dShape3d code and tilted the object. In doing so, it looks as though the t2dShape3d object is nothing more than a frame that displays a 3d object. So in order for an the object to be displayed correctly, the t2dShape3d object needs to be parallel with the camera and within that frame its perspective needs to change appropriately. This was just a quick experiment, so I am all but ready to be wrong about this.
#45
09/14/2008 (11:36 am)
Okay, ya, I've done that. You probably just need to rotate the flat frame back toward the camera. It's the same trick I did for the trees (see above). Once you do that, they will properly appear to be standing. All the scaling will be handled automatically.
#46
10/25/2008 (10:44 pm)
Well done Chris - I think this is awesome thing.
#47
10/27/2008 (1:32 pm)
Thanks! I've been busy "irl" but have managed to build in quite a bit of optimization into the mode7 mod. Hopefully I can get a simple game up online soon and get some input. :)
Torque 3D Owner Chad Kilgore