RHY you can do it! Peer pressure!
I think it's cool to have challenges like this. I hope to see more, I may want to join.
I thought about this problem too.
To simplify, the cube can rotate up and down (y pitch) and side to side (z yaw) (but not x roll)
Have 9 circle sprites for rendering the top and bottom stickers, depending what side we're viewing.
each circle sprite is red, but can change its color depending on what sticker it is representing.
Each circle sprite has several red costumes, varying from a circle to a horizontal ellipse to almost horizontal line depending on the y pitch of the cube.
The sides are the same except there are two sets of 9 colored sprites, and their costumes vary from circles to vertical ellipse to almost line- depending on the (z yaw) rotation.
they switch sides depending on the rotation, set one renders sides 1 and 3, set two renders sides 2 and 4. depending what side is facing the camera.
(I made a project sort of like this a while back: http://scratch.mit.edu/projects/AddZero/177058 )
An advantage to having sprites this way is that you can easily know what sprite the mouse is over. then you can sense clicking and dragging. (I made that detection in my solitaire project. not hard. )and know if it's dragging up, down left or right- to know what direction to rotate the row/column.
that needs to be rotated. and if the mouse is on the edge of the screen and not touching a circle sprite, and clicking and dragging, it's assumed the user is trying to rotate the entire cube.
Then just have a sprite that draws the the outlines of the cube. it gets a bit tricker if you want to animate the sliding.
Last edited by AddZero (2009-12-31 11:49:14)
Offline
Offline
fg123 wrote:
Do I look like that?
![]()
Yes.
Offline