ScratchData LogoScratchData
Back to nicolasx's profile

3D bouncy UFOs

NInicolasx•Created June 3, 2008
3D bouncy UFOs
4
2
192 views
View on Scratch

Description

A ball bouncing in a room. This new version should be easier to work out and also to make remixes from. One loop does all the display, and another one does the position in 3D - bouncing, falling etc. To remix, try duplicating the ball, and you'll get a second ball in no time. Change its starting coordinates and speed. The old notes are here: To understand this, download it first (!). The ball has 3 co-ordinates in the room: x, y, z positions (z is depth away from you). First, we decide on the proportions of the space where we are working. I wanted the ball to be half the size when it's at the far end, so z is transformed following this formula: zfactor = 1+(z/400) This way, if - z=0, zfactor = 1 (max size) - z=400, zfactor = 2 (furthest away, min size) Now to place the ball we do: screen x = x/zfactor screen y = y/zfactor size % = 100/zfactor Simple, innit? It's called one-point perspective. To get the ball to move, we use speed co-ordinates, like a ball in 2D, only there are 3 speeds, for the 3 axes. I added a co-ordinate to the "gravity ball" example provided with the samples. Enjoy scratching!

Project Details

Project ID180176
CreatedJune 3, 2008
Last ModifiedJune 3, 2008
SharedJune 3, 2008
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root