Jump to content

Intersect Node in Point VOP


talen.herzig

Recommended Posts

Hi guys,

 

I'm working on the following project: https://www.sidefx.com/index.php?option=com_content&task=view&id=2569&Itemid=389
Specifically, the pin table at the end of the project.

 

My problem is that when he uses the VOPSOP in H12.5, the intersect node is different, particularly in that it has an option for "Furthest from ray origin", which doesn't appear in the Point VOP in H14. While I understand what he's doing, I'm not entirely sure how to replicate it without that option within a Point VOP, so my results are completely off. I can't figure out how to calculate the distance between the two points, especially when it comes time to try and calculate any form of overhang, because it's not calculating the bottom points accurately at all. Can anyone point me in the right direction? I was thinking there might be some roundabout way to do it with the Intersect All node instead, but I can't put my finger on what it might be that doesn't require a damn sight more work than it should have with the VOPSOP option.

 

Also, is there a way to bring in the old VOPSOP, and is there a reason why I should be using the Point/Attrib VOPs instead? This isn't the first time I've had this sort of problem, where something seems to be way more complicated to do in a Point VOP than a VOPSOP because there's a node or option missing in the new VOPs.

 

 

My scene file is the effect attempt.hipnc, and the lesson scene file is also attached, pins_003.hip.

 

Thank you in advance, I appreciate any help.

pin table effect attempt.hipnc

pins_003.hip

Link to comment
Share on other sites

 

 

Also, is there a way to bring in the old VOPSOP, 

 

 

run 'opunhide Sop vopsop' in the HScript Textport.  Also opening an older project with the VopSop, I think, brings in the VopSop.

Edited by tar
Link to comment
Share on other sites

Thank you, that's enormously helpful. Sadly, even half the time when I look at the VEX node examples in the help documentation, they seem to still have the VOP SOP haha. I think I'll end up using this more often until I actually manage to master the software enough to be able to get creative with solutions later down the line. From what I've read, it seems the new VOPs are more efficient but I doubt it will make a huge difference to anything I do any time soon.

Link to comment
Share on other sites

So, in an unexpected turn of events, the VOP SOP still has the same version of the intersect node, which doesn't have the option either... it appears the only way to get that particular version of the intersect node is to copy and paste it in from the lesson files, lol. That's disappointing...

 

The only thing I can think of to try and do is to perhaps come up with some way to create a loop system that keeps running the Ray node until it detects no more intersections, but that seems inefficient and wasteful and I'm not sure how to implement it either.

 

EDIT: I copied the VOP SOP from the lesson into my project, and it worked fine. I tried to view the VEX code for the VOPSOP to see if there was a way I could get the same functionality of the intersect node in a Wrangle perhaps. However, the intersect function in the code doesn't match any of the intersect functions in the H14 documentation:

prim = intersect(file, P, product, pos, u, v1, "farthest", farthest);

I can't find any version of that intersect function that takes those parameters, so I'm still stuck being unable to use it effectively. So, that sucks.

Edited by talen.herzig
Link to comment
Share on other sites

Hey there,

just now I was wondering why the farthest option isn't there anymore as well. After some fiddling around I found that the distance is now included in the Ray Direction parameter. Thereafter (stupid me) I had a look at the documentation and surprise, surprise ... it's all there http://www.sidefx.com/docs/houdini14.0/nodes/vop/intersect .

Link to comment
Share on other sites

Hi MCGrund. I thought the distance was included in the Ray Direction before? That was my understanding, anyway. Is there a way you got that Intersect node to ignore the closer intersections? The documentation states that "In the case of multiple intersections, the one closest to the ray origin will be used".

 

I'm half tempted to just use the old function with the farthest parameters and do it via VEX with that, but that seems like a less responsible way to do it since I have no idea how it actually works specifically, just that it still does.

Link to comment
Share on other sites

Hey Talen, you're probably right. I was a bit tired when I read this yesterday and posted my reply. Sorry about that :) .

You can use the "intersect_all" vop to get the farthest distance. It stores all your hit positions in a vector array and also gives you the number of hits. You can then use this "hit number" (-1 because an array starts with 0) to get the last and thereby the farthest hit point. For this use a "get element" vop. Take a look into attribvob1 of the attached file. Hope this helps.

intersect_all.hipnc

Edited by MCGrund
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...