Jump to content

Sweeping roll attribute per vertex


badoumba

Recommended Posts

Hello,

I just made a path and a sweep from a line. The extrapoints generated by the sweep SOP has an altitude defined by the shape of the curve itself. You can see on the attached picture that the point 71 is not at the same altitude than the point 70, and the relative altitude difference is different for each couple of points.

I would like the created surface to be plane. So point 71 has to be the same altitude than the point 70, 73 the same altitude than 72 and so on. The Point SOP doesn't provide me that flexibility as $TZ just refers to the current point but I have to make it equal to $TZ of the previous point only if it's odd number. Thus I will obtain a flat surface along the complew curve, like a road in mountains for example.

If someone has a suggestion, I am new in Houdini and don't know all the tools.

Thanx

PS:I found that tutorial

http://odforce.net/wiki/index.php/Get_points_from_primitive

Where and how should I implement that code to play with it? Thanks

post-3320-1224685990_thumb.jpg

Edited by badoumba
Link to comment
Share on other sites

Er, I don't understand what you mean by "plane". You want the surface to be flat? Just use a Point SOP and replace $TY with 0?

I think he wants each segment to have the same elevation ("flat").

If that's the case, then I think the SweepSOP won't give you enough control, but you could always use a CopySOP. The CopySOP will pay attention to a few attributes when orienting the copies, two of which are the normal "N" and the up vector "up". Since you want all copies parallel to the XZ plane, you can set N={0,1,0}. Then you can use the PolyframeSOP (we finally have this, yay!) to compute two tangents orthogonal to each other and N (aka a "frame"). Use one of these two tangents as the up vector and you're done.

The resulting frames:

post-148-1224694653_thumb.jpg

The Y-values (altitude) are the same for each segment:

post-148-1224694659_thumb.jpg

orientedcopy.hip

Link to comment
Share on other sites

Hi again.

Thanks Mario! Sorry if it was not clear enough but I thinks it's exactly what you explained here :-)

I was not sure to be able to do the trick only with SOPs but you manage!

Thanks for the attached file and the time you spent for that.

Badoumba

Link to comment
Share on other sites

Hi Mario.

It works well :-) but could you explain me a little more about the purpose of this PolyframeSOP? What do they mean by "frame orthogonal" in help files?

I still have a problem after the copySOP when I replace your procedural curve by a Curve shape that my team need for the project. You can see on the attached picture that one of the points are not computed correctly. I also joined the file if needed.

Thanks,

Badoumba

post-3320-1224749899_thumb.jpg

RoadFromCurve.hipnc

Link to comment
Share on other sites

Yeah, it seems to be having trouble calculating the differentials for the first point in this case... possibly worth an RFE to toggle extrapolation on open curves.

Anyhoo. It's OK, you can still do this, albeit without using the new toy (PolyFrameSOP) :(

Keep the normal pointing up {0,1,0}, but then calculate the tangent using CHOPs, where you can explicitly force extrapolation (extend by slope at either end). This becomes your new "up" vector.

post-148-1224773153_thumb.jpg

RoadFromCurve2.hipnc

P.S: this will work as long as your "road" curve never goes directly up (i.e: exactly along {0,1,0}) -- it will probably fail in that case, though I haven't tested it.

P.P.S: Another solution is to use the old method (with the PolyFrameSOP), but build the road such that you can delete the first or last point.

Link to comment
Share on other sites

Mario,

You have at least 6 years more than me intensive experience with Houdini and more than 1,000 messages in that forum. So to say that I don't understand what you add on my file but it will come slowly, I hope. Since then, thanks a lot - I can use it for my purposes as it is now :-)

Badoumba

Link to comment
Share on other sites

Mario's help is always a bit extreme :)

the nice thing about Houdini files is that you can step through each node and see how it contributes to the final result...

this thread reminded me of the old rollercoaster tutorial -> http://odforce.net/downloads/videos/v6/overview/

you might want to check it out...it's old so many things may be different, but it's worth watching.

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