Anim8or Community

General Category => ASL Scripts => Topic started by: Pirmin on October 11, 2008, 04:38:35 am

Title: Object must always look ahead
Post by: Pirmin on October 11, 2008, 04:38:35 am
I have a vehicle the does some movements (I start with a circle).
My vehicle always should look ahead where it is moving to.
I will write the Location Controllers to do more movements (e.g. lines, curves, ...) depending on the current frame.
I could in parallel write Orientation Controllers to set the desired orientation at any location.
Isn't there a way to just write a single Orientation controller which always assures that the orientation stays ahead?
Title: Re: Object must always look ahead
Post by: Kubajzz on October 11, 2008, 04:45:33 am
You can try creating only the position controller and set the orientation to "facing path".
Title: Re: Object must always look ahead
Post by: Pirmin on October 11, 2008, 05:24:59 am
I have tried a lot.
???
Title: Re: Object must always look ahead
Post by: Kubajzz on October 11, 2008, 05:38:15 am
Oh, sorry, I wrote "facing path", I meant "Relative to Path"... Yes, you're right, I've just tried it and I found out that the "relative to path" function doesn't work when the path is created by a controller script...

I'm afraid you'll have to animate the orientation by hand... Or you can use key frames instead of a controller script for position - that would make "relative to path" work correctly...
Title: Re: Object must always look ahead
Post by: Steve on October 12, 2008, 05:52:43 pm
Hmm.  The problem with controller scripts for position is that they have no derivative - i.e. direction.  They only return the position at a specific frame.  I suppose I could evaluate the position at frame N-1 and N+1 and use those to create a derivative.  This would require me to change how controllers are evaluated in general.  Now Anim8or assumes that only one frame's data is needed at a time.
Title: Re: Object must always look ahead
Post by: Pirmin on October 13, 2008, 03:44:03 pm
To solve my problem I have used key frames for animation as proposed by Kubajzz.
Therefore I don't need the feature "look ahead".
But I think it could be usefull in future for me and for others.
Title: Re: Object must always look ahead
Post by: 3D Joe Wiltshire on October 14, 2008, 07:06:41 pm
Sounds like a good idea, random moving objects in the background would be a lot easier for people who are able to actually write that sort of script, it would free up a lot of time.

eg.
Get random planes to fly around, without having to make them face the right way frame by frame.
Title: Re: Object must always look ahead
Post by: kreator on October 14, 2008, 07:35:58 pm
this might help ....http://www.anim8or.com/smf/index.php?topic=959.0