Object direction of animation

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  10 October 2012
Object direction of animation

I'm attempting to rotate the object in the direction of it's animation.
Seems like it is close.

	delete objects
	tp = teapot size:10 pos:[0,0,0]

	posArr = for i = 1 to 20 collect ([(random -200 200),(random -200 200),(random -200 200)])
	idx = 1
	for i in 20 to animationrange.end by 20 do 
		animate on (
			at time i (
				tp.pos = posArr[idx] 
				tp.dir = posArr[idx+1] 
		idx += 1
____________ ___ __ _
John A. Martini
  10 October 2012
A few things:
1) Direction is defined along the Z-axis. Which on a teapot is pointing up, so you will need to compensate for that.
2) You need to set the direction ahead of the position, something like:
at time (i-20) do (
tp.dir = posArr[idx]
before you set the position in the existing code. Otherwise you are looking ahead at frame 20, but not for frame one and the last frame as idx+1 will eventually error out.

"The Evil Monkey hiding in your closet."
  10 October 2012
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 11:30 PM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.