[help] vertical distance of a pt on surface to edge of surf

   3620   7   2
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
May I get some advices on how to calculate the vertical distance of a point on a vertical surface to the top edge of that surface as shown in the image below?

I tried to do it via VOP but realizing that point on the surface will not be able to move along the surface…

Thanks!

Ji

Attachments:
bgeo.zip (6.0 KB)
untitled.hipnc (50.9 KB)
Picture1.png (2.4 KB)

User Avatar
Member
512 posts
Joined: July 2009
Offline
well you can just take the point in the upper left corner, take it's y position and subtract it by the red points y pos which will give you exactly what you want!

Manu
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
User Avatar
Member
299 posts
Joined: Jan. 2010
Offline
asnowcappedromance
well you can just take the point in the upper left corner, take it's y position and subtract it by the red points y pos which will give you exactly what you want!

Manu

The problem is probably more figuring out which point that is and even then its not correct because there is no way to guarantee that the two top points are at same Y height and if it differs you can not just use one of the points.
Drive, monkey, drive!
User Avatar
Member
512 posts
Joined: July 2009
Offline
in that case you can take the top face, scale it up and shoot a ray with the RaySop in the positive y direction and you're all set !
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
User Avatar
Member
299 posts
Joined: Jan. 2010
Offline
Same problem.

You can probably get the closest polygon and by that at least knowing which one the point is in but how do you know which polygon is the top polygon.
Drive, monkey, drive!
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
Hi, thank you all for your input!

Yes, I thought about the method of isolate the top surface using delete node and shot points upward using Ray node. but the issue here is that the top surface is not there and it may take some time to create one based on these vertical surfaces…

thanks again!

Ji
User Avatar
Member
606 posts
Joined: May 2007
Offline
Yep, this is not an easy one. Some thinking-aloud-by-myself:

Do you need this info inside Houdini or during rendering?

You could perhaps do something with the raw polygon s and t coordinates, and especially with their derivatives. I think Mantra gives you derivative vectors for increasing s and t, in the plane of the polygon. (I don't have Houdini here at the moment).

You could calculate the ds+dt vector combination that's closest to (0,1,0), and calculate how far the current s,t is from the edge.

For non-quads it could get hairier, I guess you could do special cases at least for tris..
User Avatar
Member
512 posts
Joined: July 2009
Offline
haha this is getting interesting.

Ok here's another approach:

You know the number of vertices of the face the vertex lies on and you have the face normal. Test which vertices are above the faces centroid or center of mass (vertices A). Copy this new selection and move it in the direction of the face's normal (vertices B). Then create a new face out of vertices A and B and be sure to offset them back a little bit so the ray that you are going to shoot now hits the new face.
And yes, you can do all of that procedurally

Edit: forgot to mention that you have to clamp the Y translation to 0 when moving the points along the normal!
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
  • Quick Links