I wanted to use something like a cuboid--a thin, 3d rectangle to connect between two 3d points. They idea is it would be a 3d cursor. I'm trying to manipulate the position, rotation, and scale vectors of an Irrlicht-generated cube to get this. Position and scale are easy: average the coordinates for the center point and use absolute value of diff for scaling. I'm stuck with rotation. Let's say for now I'm ignoring one coordinate plane by connected (5, 5, 0) to (0, 0, 0). Attempt #1 was to use atan2 in something like this:
X = atan2(y, z)
Y = atan2(z, x)
Z = atan2(x, y)
I end up doing a multi-axis rotation this way, when I only need to spin around the Z.
I was given some advice to just normalize the difference vector, and that is also a multi-axis rotation.
None of this factors in the order in which I apply all this stuff. I suppose if I set the position, then scale, then rotate, I'll get something goofy. So how can I enforce ordering to this?
