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
Distance Vop?? how to get one maximun distance??
7182 4 0- khermah
- Member
- 33 posts
- Joined: 5月 2006
- Offline
- pclaes
- 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.
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]
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
- khermah
- Member
- 33 posts
- Joined: 5月 2006
- Offline
- pclaes
- Member
- 257 posts
- Joined: 11月 2007
- Offline
this should hopefully clarify it for you:
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
- khermah
- Member
- 33 posts
- Joined: 5月 2006
- Offline
-
- Quick Links