Jump to content

Twist complex objects


maxpayne

Recommended Posts

Hi Guys. I need to get curved object to be twisted. "Bend" node won't work here as I will have complex shape later on and twisting should consider the shape of the object. I'm using a curve to drive the object shape so I have attributes such as pivot points and axis for each point. The only thing I need to do is to rotate those points around axis on specific angle. Sounds quite straightforward but I can't make it work. I tried lots of approaches but nothing worked well. On the image below. On the screen left I have the object that I need to be twisted. Middle one is the result that I got using matrices. It looks promising but points got scaled for some reasons. And the right one is the Quaternion rotation that does something but looks like axis is wrong even though it should be correct. 

Does anyone know how to do it properly ? 

 

Thank you.

rotation.jpg

Link to comment
Share on other sites

I believe it won't work. I have more complex shape that has bunch of details on it and I would like to see them twisting as well. I could probably use sweep for a point deform but that's extra work. I'm sure there is a simple way of rotating points around axis. 

object_example.thumb.jpg.33e51a7c3c66fcae965f18fd5f5cdc2d.jpg

Link to comment
Share on other sites

I threw together a quick and dirty solution. Its about as straightforward as I could think of. Two things to keep in mind is that 1) each "slice" thats going to be rotated needs to be transformed about to the world origin and 2) rotations usually need to be in radians, not degrees. Double check your setup cos it looks like those two things could be causing your issues. Anyways have a poke through the file hopefully it helps. If you need some extra clarity in the code have a quick read of this piece... http://www.tokeru.com/cgwiki/index.php?title=HoudiniVex#More_on_rotation:_Orient.2C_Quaternions.2C_Matricies.2C_Offsets.2C_stuff

twist_object_around_curve.hipnc

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