Jump to content

Rotation problem

Recommended Posts

I got a small rotation problem.


What I want to achieve is that the blue square's end position is exactly the same as the red square's.


The values I got for each square is the position (center), the normal and the up vector.


So far I tried my luck in the attribute vop with the align node with little luck. So, open for every idea. What I need is something like and align node with input for the two up vectors.






Link to comment
Share on other sites

O.k., what I achieved so far in an attribute vop


I pump both primitive normals into an align node > matrix to quaternion > quaternion rotate > rotate the blue primitive points.


So far, so good. Both primitives are aligned in such a way that both normals point into the same direction. Excellent!


Since I rotated the blue primitive, I also rotate it's upvector which I imported via a promoted parameter.


Next step is to pump both up vectors into an align node > matrix to quaternion > quaternion rotate > rotate the blue primitive points. Quite good.


In most cases now both primitives are properly aligned, BUT as soon as the dot product of the both up vectors seems to be -1 (so far that's the only idea I have), flipping is occuring (180° on the normal axis) or the rotation axis flips and isn't anymore the normal of the primitives.


So, it seems to me that the align node in some circumstances isn't working correctly? Or what am I missing? This is really a pain in my behind since I waste hour after hour to solve this simple task. At least it should be simple..., isn't it?





P.S.: The center of both primitives in my case is in the center of the coordinate system.

Edited by Pancho
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.

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