Game Development Community

Camera or 3D Shapes with Perspective view

by Rivage · in Torque Game Builder · 02/20/2007 (11:07 am) · 5 replies

Hello

Is this possible to add some kind of perspective view for 3D Shapes ?

Even if i need to change the sources of Camera or 3D Shape Object rendering...

I would like to reproduce the same "street effect" that you can see with old GTA2 (http://www.gouranga.com/images/gta2/gta2-3.jpg).

From a top down view, building are too flat :(

Thanks

#1
02/28/2007 (6:45 am)
Well i suppose not ^^
#2
02/28/2007 (10:16 am)
I'm sure it is possible. My guess is you aren't getting any responses to the thread because no one here has a good suggestion for how to go about doing it. If you are willing to modify source I assure you it is within the realm of possibility.
#3
02/28/2007 (11:08 am)
I'm not sure about that, but it could be achieved using sprites like the kork in Adventure kit. Just a guess. =P
#4
02/28/2007 (12:10 pm)
If your camera is going to stay a fixed distance from the 3D objects (as in GTA) you could fake it by baking perspective into the 3D shapes themselves.

Otherwise I'd guess you will need to mess with the projection frustum in t2dShape3D.cc and enable perspective instead of ortho view.
#5
02/28/2007 (1:54 pm)
Here is what I have tested so far (dont have source in front of me)

1. If you want a fixed camera angle so all your objects have an isometric view
- in your render method for t2dshape3d class, you apply a single axis rotation prior to rendering mesh.

2. I did a quick test of changing the projection frustum from ortho to perspective and my shape was getting clipped badly. Currently camera is fixed and only renders the single object, so how would you apply perspective needs more thought. Its been a long time since I dealt with 3d cameras using opengl/directx calls.

3. Final idea: I was actually waiting to post in this thread till I prototyped it because your question is interesting, but here it goes. Note: I dont know how yet, just ideas:
- Using the window space your 3d object will be rendered at, get the x,y distance from the center of the window
- using your x,y distances you would then apply a rotation along the axises of the 3d object. Depending on how far from the center, the rotation would then max to some value in each x,y direction.
- Problems: probably a lot depending on what structures you have rendering. Another problem is just the way TGB renders each object individually in its own screen space.

If I find anything more I'll post back.