ScratchData LogoScratchData
Back to mopper2's profile

3D bouncy ball[1]

MOmopper2•Created June 21, 2010
3D bouncy ball[1]
1
1
89 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 ID1140280
CreatedJune 21, 2010
Last ModifiedJune 21, 2010
SharedJune 21, 2010
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root