Mode 7 demo + full source!

Has anyone figured out how to add objects to the track? such as trees/signs/buildings?

I’ve been playing around with the code for awhile and am having difficulty adding objects to the world, they end up flat on the tiles.

Any help would be great!

I think you’d have to do it differently ; your Mode7 tiles are flat projected, your sprite images are projected using the same positional calculations but are sprites scaled for distance - for simplicity they might look the same from any direction.

Did you know ; the first “Mode 7” console was built in the early/mid 1970s, but never released ?

Do you have an example of how to do that using the Mode7 Demo? I’ve been trying but have had no luck.

No, I haven’t ever played with it.  

The hard bit is figuring out where the bottom middle of each tile is. For simplicity, initially, you would want to put each object in the centre of each tile. This probably is in the Mode 7 code somewhere. Then you have your sprite image - a tree say - arrange this so its anchor point is at the middle bottom and move it to the position on that tile, scaling it by perspective distance based on the 3D coordinate not the mapped 2D one. This might well be extractable from the tiles 2D coordinates, this tile’s display size should be scaled the same as the  objects on it pretty much - tiles further away are smaller too. 

Visibility of objects could be done using visibility of tiles - if you can see a tile you can see an object on it. Not 100% accurate, but probably good enough.

Objects would probably look the same from any direction. If you wanted to have something like (say) cars spinning as on Mario Kart, it would be easier to do this as a sprite that is animated to look that way rather than actually trying to do real 3D calculations. 

Have a look at https://www.youtube.com/watch?v=n5luQlkfWhI which is a run through of the 1982 Vectrex game “Dark Tower” or https://www.youtube.com/watch?v=hF0Cd-aKIWM (the 1983 Sinclair Spectrum game “Death Chase”) - these are both examples of fake 3D gaming produced in this sort of fashion. What you want to do is take this approach and put it on top of the Mode7 graphics. Corona would look much better as its a bit more powerful than a Speccy or a Vectrex :slight_smile:

The Mode7 demo is awesome, but there’s a degree of practicality in it. If you really want 3D, something more than (say) Mario Kart or Wolfenstein or Knight Lore, but real 3D, Corona is (at present) the wrong tool, for all its many strengths as a 2D tool.

Those are some good examples!

I finally figured it out myself, after playing around with code for hours lol. Now I have the ground plus Objects that give off the appearance of true 3D, and my whole faux 3D world is setup, never thought I would be able to do this with corona!

Thanks for the input. 

Any clues as to how you managed it? Im  trying to do a similar thing, but just can’t work out how to convert from 2D - 3D and back

Thanks

This is amazing!  B)

Hi @rakoonic, this amazing project is teaching me a lot, but I am curious about the file gfx.lua, is this an external lib or you developed especifically to this project? 

Any clues as to how you managed it? Im  trying to do a similar thing, but just can’t work out how to convert from 2D - 3D and back

Thanks

This is amazing!  B)

Hi @rakoonic, this amazing project is teaching me a lot, but I am curious about the file gfx.lua, is this an external lib or you developed especifically to this project? 

@hiphopsded Any chance you can share your solution?  I’ve been trying to figure out how to add objects to the ground (like trees) and can’t get the conversion from 2D>3D coordinates figured out.

Thanks in advance.

@hiphopsded Any chance you can share your solution?  I’ve been trying to figure out how to add objects to the ground (like trees) and can’t get the conversion from 2D>3D coordinates figured out.

Thanks in advance.