This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2007-05-27 16:03:26

S65
Scratcher
Registered: 2007-05-18
Posts: 100+

Psuedo-3D

Is there any way to make a psuedo-3D (a la Wolfenstien 3D or the original Mario Kart for SNES) game with Scratch? If so, how would it work? I've uploaded an application which draws and rotates a 3D triangular prism, but it uses the pen, and would take a long time to make a level with using that system, so I can't do that.

Thanks,
S65

Offline

 

#2 2007-05-27 19:38:00

jay
Scratch Team
Registered: 2007-03-11
Posts: 59

Re: Psuedo-3D

Hi S65,

This is a good challenge. (By the way, I think your 3d triangular prism is fun) Scratch's specialty is more with 2D, but it is very possible to do 3D if you do it the right way. There are probably several ways of doing this. I'm going to tell you about one that I've tried in the past. Take a look at the "USA Fish" sprite in this project:
http://scratch.mit.edu/projects/jay/897

It is using 2 tricks to give a 3d appearance:
1) PRE RENDERED GRAPHICS
Your 3d prism is really cool cause it draws in real time. But if I wanted Scratch to respond fast and show different angles of something like mario (for super mario cart) I might have to do some "pre rendering". I'd draw the different angles of mario that I want to use, and then just switch between different costumes when appropriate.
2) CHANGE SIZE BASED ON Y POSITION
In Scratch, when I want something to look like it's moving in 3d, I do something like
Set size to (y position + some number)
That way, when it moves around on the screen it seems to move "in" and "out" of the screen.

I hope these tips give you some ideas.

Offline

 

#3 2007-05-27 22:51:11

S65
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: Psuedo-3D

Well, those tips are only for the sprites. My real problem here is rendering the level itself in 3D. I want it to be something like Mode7 (which can render a tile map like this into a flat 3D plane like this). Even though Mode7 is much simpler than real 3D, it involves a lot of complex perspective functions. Here's an article about Mode7 on the GBA, which I honestly can't understand much, but could be useful.

Offline

 

#4 2007-05-27 22:57:51

jay
Scratch Team
Registered: 2007-03-11
Posts: 59

Re: Psuedo-3D

Ahhhh! I see what you mean. That would be useful. As far as I know, that can't be done on the fly within Scratch. But it can be done in Photoshop or Gimp ahead of time and then put into Scratch. I guess you have some experience in making games.

Offline

 

#5 2007-05-28 03:35:06

Canthiar
Scratcher
Registered: 2007-05-16
Posts: 100+

Re: Psuedo-3D

What people refer to as Mode7 can only be done on the SNES and GBA because of the unique way that hardware works.  They only require that you set a few hardware registers per scan line.

With Scratch you would have to write your own rasterizer and it would be really slow.  You could do a wireframe renderer, but I don't know if you could get that to render in real time.  Doing true 3D calculations requires a lot computation and management of a lot of variables.

Offline

 

Board footer