PDA

View Full Version : adding a tilt angle


rgarimella
06-11-2002, 01:17 PM
Hi All,

I was Planning to Move a Sphere on a YZ or XZ plane. With the code below, I can only move it on the Z Axis. Any ideas how i can add an tilt angle to it.

Thanks in advance. The code is from a tutorial on this site.
Ravi

onClipEvent(load){
radius = 200;
perspective=500;
degrees=0;
}

onClipEvent (enterFrame){
angle=degrees * (Math.PI/180);
degrees += 2;

xposition=radius*Math.cos(angle);
zposition=radius*Math.sin(angle);
distance = 1 /(1-(zposition / perspective));
this._x=(xposition * distance) + _root.center_cross_hairs._x;
this._y=_root.center_cross_hairs._y;

this._xscale = distance * 100;
this._yscale = distance * 100;
_root.center_cross_hairs._visible=0;
}

pinkaboo
06-11-2002, 01:34 PM
[crosspost]

other thread (http://www.actionscript.org/forums/showthread.php3?s=&threadid=12724)