|
-
Apr 22nd, 2002, 03:56 PM
#1
Thread Starter
New Member
Help with equations and variables
Could anyone help me out with this problem I am implementing in the 3d package Maya 4.0?
I have a variable called 'scale', representing the scale of a looping animation clip (1 is default, 0.5 is faster, 2 is slower etc.) and another variable called 'upf' (for units per frame).
I am trying towrite an expression where I work out the speed of a body in upf and then adjust the scale of the animation clip relatively. This is computed frame-by-frame as Maya plays.
I currently have this relationship when my animation clip is as follows
distance covered : 10 units
time taken : 20 frames
therefore, the body is travelling at 0.5 upf, whilst the clip is at scale =1
So if the body wre to go twice as fast, the clip would scale by half, to play back quicker in time with the body's foward movement.
so, upf = 0.5 > clip = 1
upf = 1 > clip =0.5;
upf = 2 > clip = 0.25;
upf = 0.25 > clip =2;
and so on.
I just need to be able to write an expression that calculates the clip scale based on the given upf in the above relationship.
eg scale = ????
If anyone could help me out withthis I'd be more than grateful!!
Ben Lambert
[email protected]
-
Apr 23rd, 2002, 09:57 AM
#2
Hyperactive Member
I think what you want is to set up you initial values, clip0 and upf0 which will make the following ratio hold
clip/clip0 = upf0/upf
with clip0 = 1 and upf0 = 0.5
so that,
clip = clip0(upf0/upf)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|