rotate vector around another vector (and use those vectors with a copy-to-point)? SOLVED!!

   11005   1   2
User Avatar
Member
1143 posts
Joined: April 2017
Offline
Hi!

I'm making a train track and I created a curve with X,Y and Z vectors. I would like to know what function would allow me to rotate the Y axis around the X axis and later use those vectors in a copy-to-point to place wood planks.

-Olivier
Edited by olivierth - May 31, 2019 18:55:51

Attachments:
rotate_vectors.JPG (55.2 KB)

User Avatar
Member
1143 posts
Joined: April 2017
Offline
SOLVED!

Ok, so I already had my normals set in the direction of the path (in the image above, its the red vector). I also had the green vector that I wanted to pivot around the red one. for that, I had to do this vex code:
vector red = @N;
vector green = set(0,1,0);


float myRotation = chf("rotation");  
matrix3 mRot = ident();  //picks up the current matrix
rotate(mRot, myRotation, red);

v@up = green;
@up *= mRot;
  • Quick Links