I am trying to make a setup where I align an object orthographically and then after I do my operations move the result back to the original position.
I have a working way for aligning but am sure there must be an easier way...
My method for aligning now:
- Create oriented bbox
- Measure prims
- delete all but largest, then delete 1 of the largest in order to just have 1 rectangle, 4 points
- make a vector from point 0 to 1 to align with x
- make a vector from 0 to 2 to align with y
- make normals to align with z
- in vops use the align vop to align the 0 1 vector to x then use the (rotated) normals to align with z
Even though this works I assume (hope) there is a better way to find the vectors, using pointnumbers is not procedural enough imho so any tips here would be great.
But then the part I can't seem to get...
How do I rotate my result back to the original position? there must be a way to store the rotations and invert these or something but everything i tried didin't work. my vectormath and matrices could def use some work.
ofcourse i can use a point deform but that would not be accurate enough plus i am 00% sure there must be a way to invert what i did in the first vop.
Thanks!