Mode 7 type engine


Swiss_Cheeseman

SwissCM
Joined
Mar 6, 2003
Messages
873
Age
38
Im pretty sure this is possible =P

But I reckon this would be a great project! A community made racing game in the vein of Mario Kart...

What do you guys think?
 
Well, it'd be nice, but I wouldn't know how to do it (obviously; I can't code).

... Actually, to be honest, I'd prefer soemthing done with the various 3D engines people are working on... there's one that can get 270000 polygons (untextured) working at about 7fps (or was it 2700000?)

And that was around x-mas; no idea where its at now. Either way, bearing in mind Ms Croft was only around 200 of the things, and she was pretty detailed, it should be possible to get a decent true 3D game out of the GP32 if we don't bother with textures...
Or at least, that's what I'm hoping. Still, a mode 7 engine would be good until those engines start being really good :)
 
I know how to do the Mode 7 effect, but I haven't tried it out on the GP32 yet. We'd also need some fast sprite scaling code for the vehicals and items...
 
here's some stuff from the gba dev'rs site - pretty cool if you don't know how to write a m7 caster, with this you've just gotta plug the values
into your own affine scanline renderer:


Tepples Code:

You'll have to know about vector math (use Google). You'll have to know a bit about fixed point math (use Google). You'll have to know how to change the affine parameters by scanline, using hblank DMA from an array of structs into the GBA registers.

First create a 2D unit vector that points in the direction of the camera. Call this 'out'.

Multiply the height of the camera by a constant and divide it by y to get z. Similar triangles help you see the reasoning behind this.

Now fixed-point multiply this by the 'out' to get a vector 'zout'. Rotate 'zout' right by 90 degrees (trivial) and shift it right by 8 (divide by 256) to create 'right'.

For each scanline, set the hardware's per-pixel vector (pa, pc) to 'right' and scanline origin to 'zout' - 120 * 'right'.
 
Back
Top