Basic Trigonometry: flipping an image around a Y-axis. ??
Hi,
I have this code that rotates an object (a square) around a y axis.
Code:
onClipEvent (load) {
radius = 100;
speed = 5;
xcenter = 275;
zcenter = 100;
angle = 0;
fl = 100;
}
onClipEvent (enterFrame) {
z = Math.sin(angle*Math.PI/180)*radius+zcenter;
scale = fl/(fl+z);
_x = Math.cos(angle*Math.PI/180)*radius+xcenter;
_xscale = _yscale = scale*100;
angle += speed;
}
The problem is that I want the object to flip around as it goes around the radius (so that the user will see the reverse side of the square). I've tried using -Math.sin() on the _xscale but it's not perfect.
Please help a Math dropout. Thanks for your help.