Jump to content

copy sop and vector rotation?


JamieH

Recommended Posts

Hello everyone,

I've been pulling my hair out trying to make a simple cuboid follow a curve but rotate to be perpendicular (forming spaced steps) when the "steepness" is above a certain angle. I'm using the copy sop combined with a curve that has the correct normals (normals follow the flow via $TX2-$TX etc). At the moment to "calculate" the angle i've just duplicated the curve and shifted it up slightly then shifted some points closer and used an Attribue Transfer to blend where I want the perpendicular offset. The trouble is I can't work out the correct way to orientate the cuboids to be perpendicular. Do I have to do some fancy vector rotation or is there a simpler way? Every way i've tried ends up with the cuboids perpendicular but breaking the other rotation values so the cuboid no longer twists towards the flow of the curve in the other 2 axis. I've attached an image to try an explain what I mean :)

Any help would be greatly appreciated!

All the best

Cheers,

J

post-4523-128283970534_thumb.jpg

post-4523-128284039305_thumb.jpg

Link to comment
Share on other sites

Maybe this helps as well:

The problem of orientation and rotation comes up again and again. Unfortunately I can't think of any easy way that works in every case. The more I look into it the more complicated -and interesting- it gets. The maths of it can be rather involved but I think it would help if we had some expressions or nodes that could convert from one space to any arbitrary space. (There is one in vops but its restricted to a few choices, and the polyframe sop is useful as well). I keep finding myself having to build one again and again. A set of propper SESI certified expressions/nodes would be most welcome!

Edited by Macha
Link to comment
Share on other sites

  • 4 weeks later...

Hey everyone thanks for your replies! I tried the copy sop with variations of "orient" as well as sweep but to no avail. In the end I ended up creating my own sweep like sop in a vop sop! (I'm new to Houdini... is that the right combination of abbreviations?!)

It was awhile ago now and the file is at work but if I remember correctly: basically I calculate 3 vectors for each point along the curve. Tangent, Normal and Binormal then use these to transform each point of the duplicated geometry (duplicated at sop level then plugged into the vop) into place. From there I multiply the matrix with the output of a quaternion node to rotate each point around an object aligned axis.

I'll create a simple sop example and post the hip when I get a spare minute!

Thanks again for the help!

J.

PS. I'd already finished this when you pointed out the Tangent OTL Ratman, is this along the lines of what it does? I'll have to investigate at some point!

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