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

#1 2008-11-04 23:02:22

SmartIrishKid
Scratcher
Registered: 2008-07-19
Posts: 1000+

Ideas for 3D Rotation

I'm trying to figure out the best way to rotate "3D" images.  Will someone please help me?  If we create the code, it might cause a revolution of 3D projects in Scratch!

Download the costumes from here.  Then, within Scratch, clear the solid background on all of them.  This takes forever, and occasionally it will also take out part of the Sprite, depending on its color.  (The trick is to draw a transparent line over the part(s) that get erased BEFORE you try to clear.)

I think that it's best to arrange these by direction, then by action, as follows:

Directions, in order:
N-NE-E-SE-S-SW-W-NW

Actions, in order:
Stopped
Running/Walking
Attacking/Shooting
Spelling

(I would probably leave out Paused and Talking, as they can be represented well enough by just Stopped.)

I have almost no clue about rotation script, except what I know from this project.
I know it needs certain variables, such as:

DirectionMod
ActionNum
CostumeCycle


DirectionMod is mostly self-explanatory.  It finds the direction (to the nearest 45 degrees) and turns that into a number between 0 and 7.
ActionNum senses what keys are being pressed and turns that into some sort of number.  I'm not quite sure how to use this in the programming.
CostumeCycle is used to scroll through the different costumes within each action.

The formula for determining the costume is something like this:

Code:

switch to costume (DirectionMod * #) + (formula for action) + CostumeCycle

Note: "#" represents the number of costumes in each direction, which will vary.

This is what I have, and if someone could help me here, it would be appreciated.

(Note: Do not quote this, as it is the original post and somewhat long.  Just click "Post reply" at the top.)

Last edited by SmartIrishKid (2009-01-31 18:49:09)


Discuss future Scratch RPGs, online games, and more!

Offline

 

#2 2008-11-04 23:10:53

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Ideas for 3D Rotation

You don't really rotate 3D images. You have separate images that show a picture at different angles.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2008-11-05 09:24:35

dsdude10
Scratcher
Registered: 2007-09-22
Posts: 500+

Re: Ideas for 3D Rotation

like this (link to project), it took me a long time to figure out how to make the sprites costumes and how to make it point to the mouse pointer

Offline

 

#4 2008-11-05 09:35:45

SmartIrishKid
Scratcher
Registered: 2008-07-19
Posts: 1000+

Re: Ideas for 3D Rotation

dsdude10 wrote:

like this (link to project), it took me a long time to figure out how to make the sprites costumes and how to make it point to the mouse pointer

I didn't mean something that points to the mouse-pointer.  I'm trying to make it arrow-key-based.


Discuss future Scratch RPGs, online games, and more!

Offline

 

#5 2008-11-05 09:39:11

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Ideas for 3D Rotation

SmartIrishKid wrote:

dsdude10 wrote:

like this (link to project), it took me a long time to figure out how to make the sprites costumes and how to make it point to the mouse pointer

I didn't mean something that points to the mouse-pointer.  I'm trying to make it arrow-key-based.

I don't quite see what you want. Are there any game you can name that shows what you want to make? ie, Mario 64, diablo.

Last edited by archmage (2008-11-05 09:39:50)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#6 2008-11-05 12:22:28

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Ideas for 3D Rotation

Archmage, you now runescape, I think he means like that. Being able to turn the camera so that you can see a character and scenery from different angles.

Just making sure, are the files 100% safe to download. I don't want any viruses  tongue  If they are, I would be very interested to look at this.


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#7 2008-11-05 13:16:16

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Ideas for 3D Rotation

Dan01 wrote:

Archmage, you now runescape, I think he means like that. Being able to turn the camera so that you can see a character and scenery from different angles.

Just making sure, are the files 100% safe to download. I don't want any viruses  tongue  If they are, I would be very interested to look at this.

If he is asking to make a game like runescape or mario 64, that is absolutely impossible.
If he wants to make a 3D isometric game like diabo that would be possible.

Also, the files are just pictures which means no viruses.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#8 2008-11-05 13:18:47

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Ideas for 3D Rotation

Thanks, ill take a look then.


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#9 2008-11-05 13:30:11

jasb
Scratcher
Registered: 2007-11-10
Posts: 100+

Re: Ideas for 3D Rotation

archmage wrote:

Dan01 wrote:

Archmage, you now runescape, I think he means like that. Being able to turn the camera so that you can see a character and scenery from different angles.

Just making sure, are the files 100% safe to download. I don't want any viruses  tongue  If they are, I would be very interested to look at this.

If he is asking to make a game like runescape or mario 64, that is absolutely impossible.
If he wants to make a 3D isometric game like diabo that would be possible.

It's very hard and the file will probably be larger than 10 mb.

Last edited by jasb (2008-11-05 13:31:09)

Offline

 

#10 2008-11-05 13:33:01

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Ideas for 3D Rotation

jasb wrote:

archmage wrote:

Dan01 wrote:

Archmage, you now runescape, I think he means like that. Being able to turn the camera so that you can see a character and scenery from different angles.

Just making sure, are the files 100% safe to download. I don't want any viruses  tongue  If they are, I would be very interested to look at this.

If he is asking to make a game like runescape or mario 64, that is absolutely impossible.
If he wants to make a 3D isometric game like diabo that would be possible.

It's very hard and the file will probably be larger than 10 mb.

It shouldn't be that big. Especially after you compress it.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#11 2008-11-05 13:34:38

jasb
Scratcher
Registered: 2007-11-10
Posts: 100+

Re: Ideas for 3D Rotation

archmage wrote:

jasb wrote:

archmage wrote:


If he is asking to make a game like runescape or mario 64, that is absolutely impossible.
If he wants to make a 3D isometric game like diabo that would be possible.

It's very hard and the file will probably be larger than 10 mb.

It shouldn't be that big. Especially after you compress it.

Don't forget about the music. Projects would be boring without the music.

Offline

 

#12 2008-11-05 13:44:58

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Ideas for 3D Rotation

jasb wrote:

archmage wrote:

jasb wrote:


It's very hard and the file will probably be larger than 10 mb.

It shouldn't be that big. Especially after you compress it.

Don't forget about the music. Projects would be boring without the music.

Some computers won't load projects with a lot of music on them.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#13 2008-11-05 18:19:49

SmartIrishKid
Scratcher
Registered: 2008-07-19
Posts: 1000+

Re: Ideas for 3D Rotation

archmage wrote:

SmartIrishKid wrote:

dsdude10 wrote:

like this (link to project), it took me a long time to figure out how to make the sprites costumes and how to make it point to the mouse pointer

I didn't mean something that points to the mouse-pointer.  I'm trying to make it arrow-key-based.

I don't quite see what you want. Are there any game you can name that shows what you want to make? ie, Mario 64, diablo.

Just go to the Web site that I mentioned above.  I have the costumes for Green Archer, and you can look at my project, which is as far as I have gotten.  I was thinking about some kind of top-down scrolling game, but I will worry about the actual game once I know what the rotation scripts are.


Discuss future Scratch RPGs, online games, and more!

Offline

 

#14 2008-11-05 18:31:18

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Ideas for 3D Rotation

I don't get why you don't just use the scripts from Mayhem's wondering knight project. It works great. You just need to set it up so that DirectionMod varaible changes when you press the arrow keys.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#15 2008-11-05 22:40:32

SmartIrishKid
Scratcher
Registered: 2008-07-19
Posts: 1000+

Re: Ideas for 3D Rotation

archmage wrote:

I don't get why you don't just use the scripts from Mayhem's wondering knight project. It works great. You just need to set it up so that DirectionMod varaible changes when you press the arrow keys.

His are a bit different from what I was looking for.  I was thinking about a scrolling game, using the arrow keys.


Discuss future Scratch RPGs, online games, and more!

Offline

 

#16 2008-11-06 21:32:57

SmartIrishKid
Scratcher
Registered: 2008-07-19
Posts: 1000+

Re: Ideas for 3D Rotation

And you can post ideas for the game itself at 3D Archer RPG Ideas.


Discuss future Scratch RPGs, online games, and more!

Offline

 

#17 2008-11-06 22:36:26

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Ideas for 3D Rotation

So are you saying that you want something like this?
http://scratch.mit.edu/projects/archmage/313838


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#18 2008-11-07 09:36:50

SmartIrishKid
Scratcher
Registered: 2008-07-19
Posts: 1000+

Re: Ideas for 3D Rotation

archmage wrote:

So are you saying that you want something like this?
http://scratch.mit.edu/projects/archmage/313838

Yeah, something like that.  I was thinking of something a bit less like a car-race game, but this would work if it had to.


Discuss future Scratch RPGs, online games, and more!

Offline

 

#19 2008-11-07 20:23:54

awsomemaster
Scratcher
Registered: 2008-04-10
Posts: 83

Re: Ideas for 3D Rotation

if you want basic rotation search full 3d enviroment it should be the secound result. or check my remake of it called 3d space. if i do the work i think i know how to make 3d objects and maby posably 3d enviroments. good luck looking.


scar the REAL 3d fps we've all been waiting for

Offline

 

#20 2008-11-07 22:33:48

SmartIrishKid
Scratcher
Registered: 2008-07-19
Posts: 1000+

Re: Ideas for 3D Rotation

Hold on...I'm working on the beta 0.75 (Sprite-test) version of the project.


Discuss future Scratch RPGs, online games, and more!

Offline

 

#21 2008-11-07 22:54:50

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Ideas for 3D Rotation

SmartIrishKid wrote:

archmage wrote:

So are you saying that you want something like this?
http://scratch.mit.edu/projects/archmage/313838

Yeah, something like that.  I was thinking of something a bit less like a car-race game, but this would work if it had to.

I changed it. I think it is what you want now.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#22 2008-11-11 22:28:33

awsomemaster
Scratcher
Registered: 2008-04-10
Posts: 83

Re: Ideas for 3D Rotation

archmage wrote:

jasb wrote:

archmage wrote:


It shouldn't be that big. Especially after you compress it.

Don't forget about the music. Projects would be boring without the music.

Some computers won't load projects with a lot of music on them.

ya if i play a game on my conputer it almost freazes and some times dose. some times i wish people would just quit putting music on games cause then i can't play them > sad


scar the REAL 3d fps we've all been waiting for

Offline

 

#23 2008-11-11 22:35:34

awsomemaster
Scratcher
Registered: 2008-04-10
Posts: 83

Re: Ideas for 3D Rotation

SmartIrishKid wrote:

I'm trying to figure out the best way to rotate "3D" images.  Will someone please help me?  If we create the code, it might cause a revolution of 3D projects in Scratch!

First, download the costumes from here.  Then convert ALL of them to 256-color.  This may take a while, so be prepared!

I think that it's best to arrange these by direction, then by action, as follows:

Directions, in order:
N-NE-E-SE-S-SW-W-NW

Actions, in order:
Stopped
Running/Walking
Attacking/Shooting
Spelling

(I would probably leave out Paused and Talking, as they can be represented well enough by just Stopped.)

I have almost no clue about rotation script, except what I know from this project.
I know it needs certain variables, such as:

DirectionMod
ActionNum
CostumeCycle


DirectionMod is mostly self-explanatory.  It finds the direction (to the nearest 45 degrees) and turns that into a number between 0 and 7.
ActionNum senses what keys are being pressed and turns that into some sort of number.  I'm not quite sure how to use this in the programming.
CostumeCycle is used to scroll through the different costumes within each action.

The formula for determining the costume is something like this:

Code:

switch to costume (DirectionMod * #) + (formula for action) + CostumeCycle

Note: "#" represents the number of costumes in each direction, which will vary.

This is what I have, and if someone could help me here, it would be appreciated.

http://scratch.mit.edu/projects/Dolfus555/205888
here look at this is this what your talking about?


scar the REAL 3d fps we've all been waiting for

Offline

 

#24 2008-11-14 20:02:05

SmartIrishKid
Scratcher
Registered: 2008-07-19
Posts: 1000+

Re: Ideas for 3D Rotation

awsomemaster wrote:

http://scratch.mit.edu/projects/Dolfus555/205888
Here, look at this, is this what you're talking about?

Not exactly.


Discuss future Scratch RPGs, online games, and more!

Offline

 

#25 2008-11-14 22:20:21

SmartIrishKid
Scratcher
Registered: 2008-07-19
Posts: 1000+

Re: Ideas for 3D Rotation

Okay, so what I was mainly looking for was with the Green Archer sprite (using only Stopped, Walking, and Attack) in the four cardinal directions.  If somebody could please just show me the scripts, I would make the rest of the game by myself.


Discuss future Scratch RPGs, online games, and more!

Offline

 

Board footer