Jump to content

odToad

Members
  • Content count

    4
  • Donations

    0.00 CAD 
  • Joined

  • Last visited

Community Reputation

1 Neutral

About odToad

  • Rank
    Peon

Personal Information

  • Name
    R
  • Location
    California
  1. FYI: 2D Convex Hull Wrangle

    Hope its ok to post an answer rather than a question here too. I was looking for a way to compute the convex hull for a bunch of 2D points and found no obvious node/HDA so I wrote one. Example problem in the attached picture: from all the shown points, eliminate all the yellow ones and create a polygon around with the blue ones. This is an example of a convex hull (wikipedia) Just create a Attribute Wrangle, set it to "Run Over" "Detail (only once)" and paste the following code into it: Now connect input 1 (thats the second one, not the first one) to a collection of points or a prim The output of this Convex Hull Wrangle will be a single polygon, clockwise when viewed from above (+y) The reason input 1 rather than input 0 is used is that no source geometry/points appears on the output this way, just the convex hull polygon. This code assumes that your points all live in the XZ plane, ie y=0 for all points. It only creates a 2D convex hull, not 3D polyhedra.
  2. I have some prims that I need to drive through a Clip SOP. Each prim has got its own clipping plane origin and direction, previously computed and stored in prim vector attributes, eg v@clipOrigin and v@clipDirection I would like to connect these attribute values to the inputs of a Clip SOP: Origin & Direction parameters but cannot figure out how to do it. I tried (just showing the Origin.x parameter of the Clip here, but the y/z and the Direction.x/y/z would be analogous: @clipOrigin.x no error, but wrong result (alway zero) v@clipOrigin.x error: unable to evaluate expression - extra tokens detected in expression ch("../nodeJustAboveClip/clipOrigin/x") error (bad parameter reference) hou.ch("../nodeJustAboveClip/clipOrigin/x") error (unknown function in expression) also tried with a spare parameter I realize the clipOrigin is not a parameter on my nodeJustAboveClip SOP, but rather an attribute on its prim output. So 3-5 are likely just plain wrong. Just in case Clip assumes it is running over points rather than prims, I also inserted a Attribute Promote SOP to copy the prim v@clipOrigin to each point. With version 1 above, the result is the same - no error but always zero. If you know how to do this, thank you in advance ! This is in Houdini 16.5 Indie -------- SOLVED: I was using the wrong syntax in the parameter expressions. You can pick up prim or detail attributes in SOP (not just Clip SOP) parameters like this: prim(surface_node, prim_num, attrib_name, attrib_index) detail(surface_node, attrib_name, attrib_index) details(surface_node, attribute) point(surface_node, point_number, attribute, index) Note these are VEX expression functions used in parameter expression one-liners, not regular VEX functions used in wrangles. The signatures of the functions are slightly different.
  3. That is awesome, thanks Luijee ! (and apologies for the late reply, my notification from the forums landed in spam folder, fixed now)
  4. This is one of those "I know it can be done in Houdini, but I cant figure out how" questions: I have a rollercoaster, with a cart nicely moving and banking along the rails. I'd like a view from the rollercoaster - as if you were an occupant, and I imagine tying a camera to the carts coordinate frame (eg including location and orientation) But the cameras are one level "up" from my cart geometry...they do have an input however... What is an elegant solution for this ? <pre apologies if this is so obvious that its a stupid question - I couldn't find anything on Google on this - but i am eager to learn>
×