Jump to content

trouble displacing curve strips along S direction


yourdaftpunk

Recommended Posts

Hi, I'm getting back into Houdini and I'm starting to explore vex and vops. The first roadblock I've run into is displacing curves. I don't want to displace along the normal, but rather along the s direction which I assume is defined with dPds? Here's an illustration of what I'm trying to accomplish, hopefully the labeling is accurate:

displaced_curve_strip.png

The curve also has UVs, with the u varying from 0 at root to 1 at tip and the v being 0.5 at every point. Generous displacement bound is added to the geo so that's not an issue. I can displace in other ways, and I can shade the curve with dPds (it would render green in this example as the curve strip is exactly on the xy plane), but for some reason I think the dPds vector is coming in all zeros for the displacement calculation.

Thanks.

-shawn

Edited by yourdaftpunk
Link to comment
Share on other sites

Thanks for the quick reply! But are s and t not just the two float coords of the surface (much like UVs)? I need to displace in the tangent or bitangent directions and dPds seems to be a vector in the correct direction (going along the width), but it is empty of values when I read it as part of a displacement shader. Maybe a bug?

-shawn

Edited by yourdaftpunk
Link to comment
Share on other sites

From your diagram above it looks like you want to displace a ribbon along it's u direction and not a curve.

Pretty simple using the PolyFrame SOP which can compute the u and v tangents from a curve or surface. When set to uv's, it creates two vertex type direction vectors for the direction change in u by default in tangentu and for v in tangentv. This means you have to build uv's. If the ribbon is built from curves it's straight forward to create NURBs ribbons and use the UV Texture SOP to build uv's using Uniform UV's.

After computing the tangentu and tangentv vertex attributes, convert to point attributes with the Attribute Promote SOP followed by a VOP SOP and the Displace Along Normal VOP to do the heavy lifting where the normal direction is either tangentu for u displacement or tangentv for v displacement.

See the attached example.

curve1_displace_ribbon.hipnc

Edited by old school
  • Like 1
Link to comment
Share on other sites

Gracias everyone!

eetu- No effect in my test scene as far as I can tell, but I'll leave it on.

old school- Good example, that's exactly what I was going for, except I wanted to build the strip at rendertime (I have a lot of curves to deal with). I'll save this as my backup.

petz- Wow, that scene is awesome. I think that's exactly what I'm looking for. There's much I don't understand, but I will try and grok it all today. Superb stuff. Also, you're specifying displacement bound in the vop network with a properties node and linking it by expression to the scale factor control for the displacement? Had no idea that was possible! Very cool. And for the displacement vector calculated in vops at shading time, you're taking the cross product of P and dPdt as the direction?

Thanks again gents,

shawn

Link to comment
Share on other sites

Thanks for the quick reply! But are s and t not just the two float coords of the surface (much like UVs)? I need to displace in the tangent or bitangent directions and dPds seems to be a vector in the correct direction (going along the width), but it is empty of values when I read it as part of a displacement shader. Maybe a bug?

-shawn

Oops, I get it now. You need "shade curves as surfaces" to get dPds to output something ... seems OK for me on 12.0.694.

Check out the attached file, It seems OK but I haven't looked all that closely at it ....

dpds.hip

Edited by sam.h
Link to comment
Share on other sites

  • 1 year later...

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...