Jump to content

return the max float from $VEL


Recommended Posts

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 by wateryfield
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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);
}
Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...