Jump to content

Per primitive rotation


sergio

Recommended Posts

Hello everyone, 

 

I am trying to recreate the per primitive rotation example i found here with VEX for learning purposes. The example file uses VOP to calculate a quaternion to rotate the points but when i do it in vex something weird happens and points doesn't behave as expected. I have also used qrotate() but no luck. Can you please take a look at file? Am i calculating the quaternion wrong?

 

Thanks in advance

 

 

Per_prim_rot_vex.hipnc

  • Thanks 1
Link to comment
Share on other sites

Hello Sergio, I am not sure but following seems to be the issue 

 

In your pointvop_rotate_prims, makeinstancexform1 vop has no input P connection. Connect P from global inputs to P param on makeinstancexform1 vop and you will notice that your vop output is matching to vex output. I am guessing when no input is connected to P it assumes (0,0,0) value for P and trans para is taking care of the position. In instance expression, pivot is giving you position so don't need to specify P = @P, set it to (0,0,0).

 

Make following changes in your code. 

vector origin = (0,0,0);

final = instance(origin,@N,scale,rotate,Q,pivot);

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