Converting Transforms To Quaternions


I’ve been trying to figure out how to convert transform information into quaternions as it would make some network traffic for a game my group and I are working on a little lighter and the lighter we can make the network traffic, the better. I know that the transform is made up of vector3s that represent the position and there’s already a quaternion for the rotation. So it makes me wonder if one can change the transform to a quaternion and maintain the data or what kinda thing would be lost? I know that quaternions are mostly used for rotational stuff from what I’ve read, but I was just hoping we can make some lighter network calls.

Thanks in advance for your help!

Someone will correct me, but a ‘transform’ is generally a 3x3, 4x3, or 4x4 array of numbers (float) which taken together in an linear-algebra way represent position, rotation, scale, and possibly skew. So if you just want to transmit rotation, you could do that with the transform.rotation. If you want 3 floats instead of 4, you could use Euler angles, but you might have some loss due to ambiguity when reconstructing it on the receiver (but it may depend on your particular needs). In any case, you’ve tossed scale and position out by ‘converting to quaternion’. If scale is not important, but position is, send position and rotation. Only if you needed position, scale, and rotation would I consider sending the whole transform.