wateryfield Posted January 7, 2014 Share Posted January 7, 2014 (edited) Hi. guys. I get stuck when solver a simple problem. How can i get the max float value from a velocity. I have a moving body and the velocity is change, I search the max expression function in help documentation, it seems not working. So i come here for help. And another problem, how can i stop the time in timeshift. For example i have a timeshift node with a change object, when the object's velocity greater than a float or the object turn red, the frame in timeshift stop. if($CR < 0.5, $F,?) what variable can i replace the time. It may be little easy, but it confuse me so much. i will be Gratitude if anyone give me a tip! Thank you! Edited January 8, 2014 by wateryfield Quote Link to comment Share on other sites More sharing options...
woodenduck Posted January 7, 2014 Share Posted January 7, 2014 When you say max float value, do you mean the magnitude of the velocity at it's greatest? You could use a length expression on the velocity vector which will return a float. You could then do a comparison to get the maximum length. Is that what you mean? Quote Link to comment Share on other sites More sharing options...
wateryfield Posted January 8, 2014 Author Share Posted January 8, 2014 When you say max float value, do you mean the magnitude of the velocity at it's greatest? You could use a length expression on the velocity vector which will return a float. You could then do a comparison to get the maximum length. Is that what you mean? That‘s what i mean. I have get the velocity use length() expression, but i don't know how to comparison one float with the next float ,then get the max value to comparison the next float again. Forgive my stupidity. Thank you. Quote Link to comment Share on other sites More sharing options...
rayman Posted January 8, 2014 Share Posted January 8, 2014 try something like this inside attrWrangle node in Detail mode: int pts = npoints(0); float @maxVel = 0; for(int i=0;i<pts;i++){ vector vel = point(0,"v",i); float mag = length(vel); @maxVel = max(@maxVel,mag); } Quote Link to comment Share on other sites More sharing options...
wateryfield Posted January 8, 2014 Author Share Posted January 8, 2014 try something like this inside attrWrangle node in Detail mode: int pts = npoints(0); float @maxVel = 0; for(int i=0;i<pts;i++){ vector vel = point(0,"v",i); float mag = length(vel); @maxVel = max(@maxVel,mag); } Hi, rayman. Thanks for your help, is it get the max value of all point at one moment, Actually i want get the float value when one point or object at it's greatest speed. I will try to modify it . Thank you. Quote Link to comment Share on other sites More sharing options...
eetu Posted January 8, 2014 Share Posted January 8, 2014 Ahh, in that case it's a job for CHOPs. eetu_max_velocity.hip Quote Link to comment Share on other sites More sharing options...
wateryfield Posted January 8, 2014 Author Share Posted January 8, 2014 Ahh, in that case it's a job for CHOPs. Hi. eetu! It works perfect,although i have no idea with CHOPs at all,but i understand it, thanks for your note. CHOPs is a great function. I will try it by VEX again. Thank you. And any tip about my second question. Quote Link to comment Share on other sites More sharing options...
rayman Posted January 9, 2014 Share Posted January 9, 2014 I think you should use Sop Solver. But if you use CHOPS, you probably already know stop frame so you just have to write it to TimeShift expression. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.