Amazing 3D projects are visible all over Scratch, so I had the idea of making a tutorial for it!
TL;DR notice: This is a pretty short tutorial, you should read it all.
Steps
1. Calculating the properties
2. Changing the variables to your choice
Step 1. Calculating the properties
Add this script to the three-dimensional sprite of your choice.
**If anything goes wrong, please tell me! I have not tested this script.**
when gf clicked forever hide set stretch to (((tilt) / (length)) * (100)) // stretching is a hackable block set size to (zpos)% set x to (xpos) // We need the variable to calculate visible x position set y to (ypos) // See above clear // We especially need to be able to clear only a certain sprite's pen trails... repeat ((((tilt) / (length)) * (-100)) + (100)) move ((length) / (100)) steps stamp end set [xpos v] to ((x) + ((zpos) * ((x) / (240)))) set [ypos v] to ((y) + ((zpos) * ((y) / (240))))Step 2. Changing the variables
(tilt) (zpos) (length) (x) (y)and then you can program normally using these variables to move the object instead, creating an awesome 3D game.
Last edited by rdococ (2012-02-18 15:41:19)
Offline
What are the blockspecs for set stretch?
Offline
The blockspecs for stretch are:
('set stretch to %n' #- #setStretchTo:)
and
('change stretch by %n' #- #changeStretchBy:)
Offline
You can use stamping to create 3D that changes with perspective
Offline