Jump to content

Facing Direction Problem


Recommended Posts

Hi everyone,

I was trying to make small objects move on the surface of a large object.

However, the small objects start rotating itself along X axi when I used points of the surface to copy and animated.

I want to make them keep facing forward (towards the direction they are proceeding).

I tried to use up vector but I couldn't make it work....

Please help me :(

Thanks in advance.

Link to comment
Share on other sites

I used the edge force in the point sop as the up vector.

Because the up attribute is a vector it should be changed alongside with the normals as it goes through the transform operations.

Basically you copies are now oriented towards their closest neighbours (this is based upon the point order that influences the way the edge force is calculated. The result is a vector formed by $PT - ($PT+1) ), do a search on edge_force here on odforce to understand some of the variable/attribute declaration better.

I don't know if this fully solves your problem?

- oops just read you wanted to keep them facing forwards, let's see if I can adjust the file a bit to do that.

facingDirection_02.hipnc

Edited by pclaes
Link to comment
Share on other sites

This one should do it,

a cross product between the z-axis (this should be the axis you are rotating around, you really want to define this somewhere in a control variable a bit higher up on the network in case you want to rotate around a different axis) and the surface normal. check the visualization null to see the what the up vector looks like.

facingDirection_03.hipnc

Link to comment
Share on other sites

This one should do it,

a cross product between the z-axis (this should be the axis you are rotating around, you really want to define this somewhere in a control variable a bit higher up on the network in case you want to rotate around a different axis) and the surface normal. check the visualization null to see the what the up vector looks like.

Yeah, This is exactly what I wanted to do!

I've never used cross product before. It is so useful :lol:

Thank you so much, Peter!

Link to comment
Share on other sites

Yeah, This is exactly what I wanted to do!

I've never used cross product before. It is so useful :lol:

Thank you so much, Peter!

It really is, dot product as well. Not that I want to shamelessly advertise or anything, but I created some video tutorials a while back which explain some of this stuff in Houdini terms. First covers a bit of the math, then convert it into Houdini expressions. So yeah, if you're curious have a look: http://www.3dbuzz.com/xcart/product.php?productid=58 It's about effects, but really it's about data manipulation in sops, pops, vops and using expressions.

Link to comment
Share on other sites

It really is, dot product as well. Not that I want to shamelessly advertise or anything, but I created some video tutorials a while back which explain some of this stuff in Houdini terms. First covers a bit of the math, then convert it into Houdini expressions. So yeah, if you're curious have a look: http://www.3dbuzz.com/xcart/product.php?productid=58 It's about effects, but really it's about data manipulation in sops, pops, vops and using expressions.

Oh, cool! I'll check it out.

I was driven by necessity to use expressions recently.

Thanks again. :)

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