Hi guys,
Does anybody know the vopsop formula for scaling an object along a vector? I want to scale an object along a single axis just as I would with a transform sop, but not explicitly down x,y, or z. My object is at a weird angle and I'd like to scale it along that axis.
Ideas?
Thanks in advance!
Scale object along vector
6784 4 0- kacheson
- Member
- 46 posts
- Joined: Jan. 2007
- Offline
- edward
- Member
- 7715 posts
- Joined: July 2005
- Offline
Create a matrix that aligns your direction vector with a regular axis that is *not* the opposite of your direction vector. So say that was the +Z axis value of (0, 0, 1). Then use the Align VOP [sidefx.com] to create this matrix that rotates your geometry from the direction vector onto the +Z axis. Now you can scale it along the Z axis. After doing this, you do the opposite by multiplying it again with the inverse of the matrix generated by the Align VOP, putting your geometry back into place. If the origin of your direction vector is not at the origin of (0, 0, 0), then you'll also need to translate it to 0,0,0 first before scaling, and then moving it back.
- kacheson
- Member
- 46 posts
- Joined: Jan. 2007
- Offline
- kacheson
- Member
- 46 posts
- Joined: Jan. 2007
- Offline
- tamte
- Member
- 8547 posts
- Joined: July 2007
- Offline
-
- Quick Links