Mode7 (The SNES way to make 3D)

Post here your demos and examples with the source files.
Forum rules
Always post the games with a screenshot.
The file must have the ged and data files (complete game source)
Use the forum attachment to post the files.
It is always better to use the first post to put the game files

Mode7 (The SNES way to make 3D)

Postby Game A Gogo » Thu Jan 13, 2011 5:39 am

For a couple of years now, I've wanted to create Mode7 inside GE, well now I have!
With the help of this site: http://pixwiki.bafsoft.com/mags/5/artic ... sincos.htm I was able to reproduce the Mode 7 effect used in many games on the SNES for 3D.
Most credit should go to the guy who wrote that, I did copy his code and made it work in GE.
Now before you get all too exited, this method is slow. Of course the code can be cleaned up a bit, I'm sure, but until GE can handle better things like that, yeah.
NOTE: remember to import your image with ImpBGBmp("Tile.bmp");

how to use Mode7:
Code: Select all
//void Mode7(int screen_w,int screen_h,double space_z,int horizon, double scale_x, double scale_y, double dangle, double cx, double cy)
Mode7(width,height,48,16,200,200,angle,x_pos,y_pos);

screen_w and screen_h is the size of the canvas
space_z is the Z position (height)
horizon is the offset vertically of the output picture
scale_x and scale_y are for scalling, I suggest 200 and 200
dangle is the angle you are facing in Degree
cx and cy is the position

enjoy!
Attachments
Mode7.zip
up down left and right arrow key for control
(60.24 KiB) Downloaded 607 times
M7test3.JPG
M7test2.PNG
M7test.PNG
Last edited by Game A Gogo on Thu Jan 13, 2011 4:44 pm, edited 1 time in total.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby Turon » Thu Jan 13, 2011 11:32 am

Cool! er is it complicated? :?
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby Turon » Thu Jan 13, 2011 11:36 am

I created this a couple of days back viewtopic.php?f=1&t=9692 . if we mix the ideas we would basically do 3D!
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby Game A Gogo » Thu Jan 13, 2011 2:23 pm

To include objects with this, you'd need to use Bee-Ant's demo or Tintran's demo.

Your method is very basic illusion, it doesn't have rotation nor distance scalling
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby Turon » Thu Jan 13, 2011 3:18 pm

I don't know how to do that can you teach me? :wink:
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby Game A Gogo » Thu Jan 13, 2011 3:32 pm

Then I'd suggest you read the website I used for refference
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby Game A Gogo » Thu Jan 13, 2011 4:44 pm

note: removed a useless round function that would distort slightly the image rendered
I'd also like to know if this is simply useless S:
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby Bee-Ant » Fri Jan 14, 2011 1:00 am

Pretty nice :D
Too bad it's slow...
Gonna take a look more then improve some ;)
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby lcl » Fri Jan 14, 2011 12:45 pm

Good job man! :D
1+ for you.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby Lacotemale » Fri Jan 14, 2011 1:06 pm

Very nice but very slow... don't think this can be used for anything at this level of performance.
User avatar
Lacotemale
 
Posts: 285
Joined: Wed Dec 08, 2010 7:47 pm
Location: /home
Score: 7 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby Game A Gogo » Sat Jan 15, 2011 12:05 am

Lacotemale wrote:Very nice but very slow... don't think this can be used for anything at this level of performance.


Unfortunatly, GE was not made to handle such things, it can be optimized, as I have a bit, I'm able to get 20 fps with somewhat good graphics, I'm making a mini game using this.
Plus there might be formulas out there that are more efficient
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby akr » Sat Jan 15, 2011 10:08 am

That looks promising. What ge support would u need?
Co-Developer of GE engine

If u are interrested in new features of apple or android ge engines check the engine support website game-editor.net regulary.
akr
 
Posts: 453
Joined: Thu Feb 25, 2010 7:56 pm
Location: Germany, Ulm
Score: 40 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby Game A Gogo » Sat Jan 15, 2011 2:54 pm

putpixel has always been slow, because canvas drawing does no benefit from any hardware acceleration.
If you try a 640x480 canvas, with just a simple code that would draw every pixel one by one with putpixel and make a blinking effect. You get 7fps on my computer, imagine with more complicated ways of drawing! It's not very convenient since we are in the 21st centuary, not the 20th.

I don't think the trigonometry in this code is to blame, it actually gets read once for every line.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby alexandrefredenucci » Sun Jan 16, 2011 1:50 pm

I like mode 7, awesome work Game A Gogo ^^
alexandrefredenucci
 
Posts: 58
Joined: Wed May 12, 2010 7:33 am
Location: France
Score: 15 Give a positive score

Re: Mode7 (The SNES way to make 3D)

Postby Game A Gogo » Sun Jan 16, 2011 2:54 pm

alexandrefredenucci wrote:I like mode 7, awesome work Game A Gogo ^^

thanks a lot :)

I'd also like to point out that 8x8 texture size will run as quick as 1024x1024 texture size, except loading the 1024x1024 in memory will take a couple of seconds
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Next

Return to Game Demos

Who is online

Users browsing this forum: No registered users and 1 guest

cron