Distance Vop?? how to get one maximun distance??

   7182   4   0
User Avatar
Member
33 posts
Joined: 5月 2006
Offline
Is there a way, be it for loop or anything so I can just get the maximum distance from a set point, in vops. The for loop kinda still gives mi all the distances, but I just want the highest distance

Any ideas, pliz

Khermah
User Avatar
Member
257 posts
Joined: 11月 2007
Offline
Just keep track of the maximum distance inside your for loop.
You can easily build that yourself with if statements, or you can use the “maximum” vop.

A bit like:

max = -1
for(i=0;i<end;i++)
{
dist = distance(A,pt(i))
max=maximum(max,dist)
}


But depending on what you are doing, you really want to be using pointclouds as they are much faster for large numbers of points. You can use “farthest” with it as well - so you always get the distance to the farthest point.

From the help:

This node returns the maximum point distance produced by a pcopen query. For example, if 10 points are being filtered, pcfarthest will return the distance to the farthest out of these 10 points. This node corresponds to the pcfarthest VEX function.
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
User Avatar
Member
33 posts
Joined: 5月 2006
Offline
wow! Straight from a great master. I admire your work. Awesome stuff. Now, Vops is how I want to but am more than stuck now. the values are kinda lower than expected.

I just implimented the point cloud idea you gave mi 10 mins ago

Khermah

Attachments:
get Highest point Problem.hip (90.7 KB)

User Avatar
Member
257 posts
Joined: 11月 2007
Offline
this should hopefully clarify it for you:

Attachments:
get_highest_point_problem_132_02.hip (225.0 KB)

Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
User Avatar
Member
33 posts
Joined: 5月 2006
Offline
Thank you sir! gonna check on it right now.

million thanks

Khermah
  • Quick Links