I have various approximately cylindrically/cuboid shaped objects. The exact shape varies, but they’re generally going to have one dimension significantly longer than the other two. Which axis is the long one, is a factor that can vary. But it has been prechecked in advance, and the object has a stored vector which indicates its long axis (for example, <1,0,0> when X is the longest)
What i need to do, is to rotate them relative to a reference object, so that they (the long axis) run perpendicular to the forward vector of that reference object.
Alternatively, i may need them to run parallel. it’s a kind of either/or thing, so i need to be able to code for both.
The roll of these objects will usually not matter. But it will matter in some cases, and for those i’ll want the object to either lie flat, or lie upside down, and not roll values inbetween. For all other cases, i want it to not specifically change, and be left at whatever it was before
And once i eventually have a target rotation, i need to do some lerping to it, not just insta setting
Perhaps some context is needed:
The reference object here, is a dog’s mouth (actually a tiny marker object inside the mouth), and the other objects i’m rotating are generally dog toys (or grabbable parts of multipart toys). My overall purpose here is to figure out reasonably logical angles for a toy to be picked up at
I need some help with the math here, i’m not quite sure where to start