# spinning bottle horizontal

## Recommended Posts

hello, I am trying to have a procedural animation of bottle spinning horizontal, I have a hip attached to demonstrate that. As you can see inside the hip I have a point where its normal vector is in spiral motion and I copy a tube to that point and everything works fine. Also it will calculate the distance of the ground based on the angle of the bottle but what is missing is the actual rotation of the tube in his y axis which should be based on the angle of the point's normal. Any idea?

spin_tube.hip

Edited by cparliaros

##### Share on other sites

Add the vector attribute "up" to the point you're copying the cylinder to with a value of "0,1,0" This is your 'up vector' which you need to have an up orientation to go with your velocity direction. I had to use that a lot when instancing creatures back in my old Maya days.

The only hint to this solution is in the upvector POP.

##### Share on other sites

Kleer001, I was just looking through this post. I haven't set this up before can you elaborate on how and where to add the up vector. Are you doing this by adding in a upvector Pop or creating an attribute named "up" and then how are you applying this to the point? A little more guidance and I think I got it.

##### Share on other sites

I don't know how you want to calculate the rotation amount, but you can use the Transform Axis SOP and plug that point's position and normal into Origin and Direction and the rotation will happen around that vector.

##### Share on other sites

Kleer001, I was just looking through this post. I haven't set this up before can you elaborate on how and where to add the up vector. Are you doing this by adding in a upvector Pop or creating an attribute named "up" and then how are you applying this to the point? A little more guidance and I think I got it.

Apply the vector "up" to the points you're copying geometry to, the points that go on the right side of the copy SOP. You can do that however you see fit. It's that "up" like "N" or "pscale" is recognized by Houdini and does a specific thing in the copy SOP process.

## Create an account

Register a new account