Jump to content

Per primitive rotation

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




  • Thanks 1

Share this post

Link to post
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

Share this post

Link to post
Share on other sites

Yes that's it. I assumed it would default to position if none is fed but apperently it was 0,0,0. Thank you Sandeep, much appreciated. 

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now