Topic: Rotating an object along a curve (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: London |
posted 02-28-2007 17:27
Hi there! code: WAVE_HEIGHT*Math.sin(n*(Math.PI*2)+WAVE_SPEED) My arrow always faces 'east', I want my arrow to rotate to the tangent of the curve. code: arrow._rotation = WAVE_HEIGHT*Math.sin(n*(Math.PI*2)) But really I just made that up. |
Paranoid (IV) Inmate From: Madison, Indiana |
posted 02-28-2007 18:36
Let me restate the problem so I'm sure I understand what you said: |
Paranoid (IV) Inmate From: London |
posted 02-28-2007 19:01
Hyperbole, that was great, thanks. code: arrow._rotation = WAVE_HEIGHT*Math.cos(n*(Math.PI*2)); and it works fantastically. I remember doing all this in Maths a long time ago, so reading this kinda made sense in my subconscious, but I'm not about to write a paper on it. |