PDA

View Full Version : Animation - object on spline - help!


kromekat
08-14-2003, 05:27 PM
Ok -I need some help... :banghead:

I have been trying to reslove a problem, which I am sure is quite simple when you know how!

I need a model (a spaceship) to follow a flightpath - I have my ship, I create a spline for the route I want the ship to take, and I have tried a couple of the spline allign expressions etc... I just cant work it out/get it to work for me...

Tell me how easy it is please! :)

btw - I am on version 8.1XL

ChrisVilla
08-14-2003, 05:35 PM
You need to set at least two keyframes for the Position attribute. 0% will place it a Point 0 of the spline where 100% will put your object that end.

_chris_

Neoklassik
08-14-2003, 05:38 PM
This help any?

http://www.maxoncomputer.com/tutorial_detail.asp?tutorialID=99&site=

ChrisVilla
08-14-2003, 05:44 PM
That would work for R7 and lower. Not for 8.

_chris_

cookepuss
08-14-2003, 05:49 PM
I recently did something like this. It's pretty easy.

1) Align the ship to the spline.
2) Create a null object
3) Add a Target expression to the ship, with the target set to the null
4) Key in the ship's movement at certain intervals (every 20% for example)
5) Do the same thing for the null object, but also rotate & move it tangent to spline. (Be sure to keep the null somewhere ahead of the ship's front so that it's always looking forward.)

This should give you exactly what you want. I'm sure that you can do this by aligning the ship to this spline and using a tangent rail curve, but this way seems a bit easier for the newbie to visualize mentally.

ewdean
08-14-2003, 11:42 PM
Ahhh, what a joy Cinema would be with a full constraint system aka Animation Master. All you would have to do is click the spaceship, then right click and select path constraint, and then click the path...boom. You're all set...

Shademaster
08-15-2003, 12:59 AM
Align to spline tag to ship

=> drag animation spline into expression

=> check tangental

=> set keyframe at 0% at frame 0

=> set keyframe at 100% at let's say 90 frames.

now the ship will move along the spline over it's z-axis (if the z axis isn't pointed to the nose you can do so by going into pivot mode and rotate the pivot point)

That is the basic procedure I wanted to tell you but my internet exploded....sorry man (got it fixed now)

:)

kromekat
08-15-2003, 01:58 AM
Wow - thanks guys! - a couple of different solutions there - the one I favour, I have to say is yours Daan, but It's not working for me, despite its simplicity.

Align to spline tag to ship

Yeah, done that - technically it's an expression tho! :)

=> drag animation spline into expression

Yup
What about the second field: Rail Path - how does that work/what does it do in addition?

=> check tangental

ok, now as well as my ship locking to the path beginning, it faces to follow it.

=> set keyframe at 0% at frame 0
I add the keyframe to the ship!? at frame 0...

=> set keyframe at 100% at let's say 90 frames.

..I then move the % to 100 in the position field of the allign expression, and the ship goes to the end of the spline, I keyframe it again at frame 90 - no problem.

But now I have a line running from the beginning of the slpine to the end as the crow flies, ie: straight, not following the path - I hit play, nothing happens!??!!??

:/

Shademaster
08-15-2003, 02:18 AM
I put a c4d file on my server to show a simple scene with all the bells and whistles so you can see how that rail path works:

www.shademaster.nl/temp/splinec4d.c4d


..I then move the % to 100 in the position field of the allign expression, and the ship goes to the end of the spline, I keyframe it again at frame 90 - no problem.

Ah, forgot to tell you that, since you are animating an expression, you can't use the move/rotate/scale/paramter etc. keyframing method. What you have to do is click on your expression and go to it's attributes menu. And control click on the position parameter:
http://www.shademaster.nl/temp/spline.gif

And add a keyframe at frame 0 at 0% and add keyframe on 100% at 90 frames. That should do the trick!

Now I should really go to bed....

:)

Shademaster
08-15-2003, 11:52 AM
I did a bit more interesting test this morning that involves the spaceship drifting a little bit (really spacy) and correct banking. all expressions no keyframes.

Get the file here:

www.shademaster.nl/temp/spaceshipc4d.c4d

Hope that gets you sorted!

:)

kromekat
08-15-2003, 01:45 PM
Ahha!

Now we have it! :) - thanks very much Daan!

I also see what the rail sline is doing, which is cool, but seems a little abstract in control - so why am I not able to simply haver my ship follow the path, and then keyframe in the rotations etc - would be preferable to me!? - also, do i not have control of fcurves using this method either?

If the only other alternative to just key eact step of the ships path in on the timeline, how can i make it's speed constant along the duration of the flight?

Shademaster
08-15-2003, 01:59 PM
I also see what the rail sline is doing, which is cool, but seems a little abstract in control - so why am I not able to simply haver my ship follow the path, and then keyframe in the rotations etc - would be preferable to me!? - also, do i not have control of fcurves using this method either?

You don't neccesarily need the railpath, that is only to let your ship bank by spline instead of by rotational keyframing (which is perfectly possible too but only over the axis that isn't affected by the tangential expression part which is probably Banking)

You do have control over f-curves indeed! You can drag and drop (everything is drag and drop) the 0-100% animation paramter from the timeline into the f-curves manager and give your ship acceleration for instance. What would suit you best I think is making the animation spline only, give it a parabolic like acceleration by using the f-curves and animate the rotation of the ship by hand. That's probably the easiest way too since it is less abstract and you can see exactly what you are doing.

If the only other alternative to just key eact step of the ships path in on the timeline, how can i make it's speed constant along the duration of the flight?

If you want to keep it's speed constant use linear interpolation (that means a keyframe at the beginning and a keyframe at the end of the animation, that will keep the speed absolutely constant, so no position keyframes in the middle.) You can also select linear interpolation by dragging the position percentage keyframes into the f-curve manager, select all keyframes and go to the Curves menu => Custom tangents => Linear interpolation.

If you send me the scene I can try it for you if you want!

:)

kromekat
08-15-2003, 02:17 PM
Daan - I got it - it's all working now man - thanks mate! :)

btw - havent seen you on ICQ or 'the board' recently - are you in hiding? ;)

Shademaster
08-15-2003, 03:03 PM
Daan - I got it - it's all working now man - thanks mate! btw - havent seen you on ICQ or 'the board' recently - are you in hiding?

I am not in hiding, just extremely busy nowadays :scream:, I got a week off next week so I can make a good addition to the board again. I don't wanna comment on anybody's work if I haven't got anything to show... expect a really big update soon!! :buttrock:

btw, I am on ICQ almost the entire day! Can't you see me when I am online?? (could be my ICQ being poopy):shrug:

Glad I could help :)

bek
02-11-2004, 07:29 PM
Originally posted by Shademaster
I did a bit more interesting test this morning that involves the spaceship drifting a little bit (really spacy) and correct banking. all expressions no keyframes.

Get the file here:

www.shademaster.nl/temp/spaceshipc4d.c4d

Hope that gets you sorted!

:)


hi Shademaster wel i download ypur file and i have a question how can i do the exact same thing but this time the object moving it is a snake!! i whant all the body of the snake fallow the target did i explain my self??


thks!

Siddhy
02-11-2004, 08:24 PM
hey bek, that's exactly what i wanted a while ago. its not that simple because you'll have to find a way to stick all points to the path-spline and make sure they keep the distance to their neighbours :(
if someone could resolve this i would also be very happy :)

//siddhy

Cubeshaped
02-13-2004, 08:00 PM
Originally posted by Shademaster
I did a bit more interesting test this morning that involves the spaceship drifting a little bit (really spacy) and correct banking. all expressions no keyframes.

Get the file here:

www.shademaster.nl/temp/spaceshipc4d.c4d

Hope that gets you sorted!

:)

Since I started working with Cinema4D few weeks back, this simple animation file have taught me a thing or two about how to use Rail and Spline properly. I'm going to keep it as a reference when I go back to school to play around with Rail and spline.

CGTalk Moderation
01-15-2006, 09:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.