Game Development Community

(Pseudo) 3d

by Lennart Steinke · in Torque Game Builder · 03/30/2005 (1:17 am) · 4 replies

Hi!

I'm telling a lot of people I know about t2d and as a response I get a lot of questions :)
While I try to answer them as good as I can (say by searching the forum) from time to time some questions pop-up I can't answer.

So, one question that came up was pseudo 3d stuff, esp. Mode-7 like effects and the pseudo 3d effect you get on the later streetfighter floors. Both could be implemented by changing either the vertices or even just the UV coords on a chunked bitmap, IMO.

I was just wondering if this topic came up before and if there's anything I could add to the "it's not there right now, but since you have the source, it shouldn't be hard to add it" answer I gave them?

Oh, and this isn't a feature request or something, just wanted to ask if this topic came up before.

Best regards
-Lenny

#1
03/30/2005 (1:33 am)
Quote:Both could be implemented by changing either the vertices or even just the UV coords on a chunked bitmap, IMO.

Mode-7 esque backgrounds are a bit more complicated than a simple change to vertices. You really do need to do a projection operation. I recall reading something about how to do Mode7 effects on the GBA, and it required setting up this scanline callback in the hardware that allowed you to bias the y-value of each scan like. It wasn't a simple linear scale either; it required more complex (but not much more) mathematics that slip my mind at the moment.

Now, since we have actual 3D hardware, it's kind of silly to use such a hack when we can just project the 2D tilemap in 3D space. It would involve setting up a transformation matrix when rendering a tilemap and switching from an orthographic projection into a perspective one. Lining up the perspective projection matrix to the original orthographic one would be a bit difficult, but certainly doable.
#2
03/30/2005 (1:40 am)
The ability to skew isn't globally in there at the moment because it does impact other aspects of the object definition in subtle ways.

I would suggest that this feature would be best suited to the custom textured polygon objects that we want to do. These can be textured and be defined as custom polygons (even non-convex) with custom UV coordinates. They would typically be used for "Flash" type work. These will be around the time of animatable property work. Too early for timescales at the moment unfortunately.

In the meantime though, the best way to do this would be to make a slight modification to the fxScroller2D (fxScrollerMode7?) so that you can simply change the vertex points as you suggested. Store them in a little table and they are only used in the render call. It would only take a couple of hours or so to setup if you follow the existing console call examples in the same object.

As Smaug suggests, using the 3D hardware to do the projection work would be good way to go. Of course, I may be skipping some of the specific aspects of the effect you require and oversimplifying what you want, I haven't see it in a while. Texturing in true 3D-space will give you perspective correct texturing of course.

- Melv.
#3
03/30/2005 (2:25 am)
Thanks for the suggestions. I'll PM my friends and try to talk them into getting t2d, heh :)

Regarding the effects suggested by Robert:

What about TSE for T2D?

/me casts Greater Invisibility
/me casts Mage Armor


-Lenny
#4
03/30/2005 (2:37 am)
/me points at search button

I'm sure these kinds of effects have been mentioned before. I think they're in the 'nice to have but a little way down the line' box.