Jump to content

[SOLVED]VEX Rotate Instances?


Atom

Recommended Posts

Hi All,

I have this mountain sphere where I have scattered a few copies of the letter T upon.

I want to be able to rotate each instance along the vertical axis of the letter T, so they spin while aligned to the sphere.

I am constructing orientation using the polyframe node but I want to control the secondary rotation via VEX.

Does anyone know the VEX code for rotating along a single axis while maintaining the original orientation setup by the polyframe?

Untitled-1.jpg

ap_VEX_random_align_to_surface.hipnc

Edited by Atom
Link to comment
Share on other sites

Thanks for taking a look at my problem file. That is almost it, however, when I install your code in my scene the rotation occurs on the wrong axis. I wonder if this is due to the scatter after the polyframe? In your scene if I scatter points, instead of using the surface points the solution is lost as well.

Do you know how to migrate the rotational influence to the other axis?

I tried swapping X and Z but that did not work either.

p@rot = quaternion(@Time, @N);
float rx, ry, rz;
rx = p@rot.x;
ry = p@rot.y;
rz = p@rot.z;
p@rot = set (rz,ry,rx);

 

rot_angle.gif

Edited by Atom
Link to comment
Share on other sites

why don't you use your up-vector instead of @N?
if I got this right, p@rot = quaternion(@Time, v@up); in your attribwrangle_INSTANCE should do the trick

and remove those other lines

Edited by 3dome
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...