I’ve got this ball that rotates around a center and I see how the speed changes with a number or with the location of the mouse, but I’d like to have the ball just rotate until the user does a mouseDown … then they can spin the ball by moving left or right. like a QTVR kinda thing… Any suggestions?
Here’s what I’ve hobbled together so far.
var fl:Number = 150;
var vpX:Number = Stage.width / 2;
var vpY:Number = Stage.height / 2;
init();
function init() {
ball.x = 0;
ball.y = 0;
ball.z = 100;
}
function onEnterFrame():Void {
var angleY:Number = .2; // (_xmouse - vpX) * .001;
var cosY:Number = Math.cos(angleY);
var sinY:Number = Math.sin(angleY);
var x1:Number = ball.x * cosY - ball.z * sinY;
var z1:Number = ball.z * cosY + ball.x * sinY;
ball.x = x1;
ball.z = z1;
var scale:Number = fl / (fl + ball.z);
ball._xscale = ball._yscale = scale*100;
ball._x = vpX + ball.x * scale;
ball._y = vpY + ball.y * scale;
}