Make copied objects face a certain point in space (and more)

   5880   5   3
User Avatar
Member
477 posts
Joined: Aug. 2014
Offline
Hello my dear Houdineers!
Please, imagine a lamprey's maw. Or just look at this picture:
https://en.wikipedia.org/wiki/Lamprey#/media/File:Boca_de_lamprea.1_-_Aquarium_Finisterrae.JPG [en.wikipedia.org]
It's full of teeth. They go all around the gullet. The question is: how can I, on a SOP level, make the copied teeth objects face the gullet (ideally, with an optional random rotation)? Any advice is appreciated.
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Copy SOP can use template point attributes to orient the teeth to a specific point is one way.

See the attached example file.

Attachments:
lamprey_teeth_prototype_v001.hip (115.3 KB)

There's at least one school like the old school!
User Avatar
Member
477 posts
Joined: Aug. 2014
Offline
Many thanks, Jeff!
I need some time to analyse the graph, mostly the VOPs.
How can I introduce some rotation randomisation in, say, two selected axes?
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
You can do it right on the Copy SOP's rotation values.

You will see that I hacked in a rotate to slightly offset the teeth in one of the Copy SOP rotate values (yes a quick hack but a good prototype). Nothing wrong with this at all btw if it does what you want to do.

Be sure that you toggle off the “Transform Cumulative” on the Copy SOP to do this.


A second approach is to manipulate the N and up vectors directly in the Attribute VOP SOP. You can use the Transform Matrix VOP to add rotate transforms to the N and up vectors directly. No radians, actual rotate values here. One of the rare exceptions in VOPs/VEX where you do use rotates rather than radians to describe rotate values.

Then you can add a Random VOP and wire in the point number as a seed then use a Fit Range VOP to map the 0-1 random value to say -10 and +10 for all three vector values in the Fit Range Vop. Now wire this in to the Transform Matrix VOP R input to rotate the vectors. Change the fit range to suit. Promote the parameters up for artist control.
There's at least one school like the old school!
User Avatar
Member
477 posts
Joined: Aug. 2014
Offline
Thanks again Jeff for your time! I do appreciate your explanation!
I'm gonna try it first thing in the morning and provide the feedback.
User Avatar
Member
22 posts
Joined: Aug. 2014
Offline
jeff
A second approach is to manipulate the N and up vectors directly in the Attribute VOP SOP….


It should be noted that this is also a good technique for copying geometry to particles. N and up vector are used but so is velocity. These three define a local coordinate system, with “v” analogous to the Z-axis, your up vector the Y-axis and your normal the X-axis. Doing cross-products of an axis against the “velocity” gets you the alternate perpendicular component (N to get Up, or vice versa).

I've used this to copy geometry to points carved from curved paths as well, versus particles, where the next point along the path acts like a velocity component, or you could trail. Adding in your own “banking” or orbiting or other rotational maneuvers and random variation isn't too hard with the Copy SOP but I'll have to give that VOP a try next time.
  • Quick Links