# Whats the bast way to do this?

Sorry, same question, different phrasing. I’d like to know the best way to store orientation data for a model object. Basically, the current (local) orientation of that model is to be stored within the class object, and loaded/combined with the orientation of the world/camera to produce the final output.

I’d rather not store a complete matrix in the object itself, because I don’t really want it to be totally cryptic in the code. I’d prefer to avoid quat’s. Vector notation maybe? Euler angles?

Whats simple? Whats data-effective? Whats fast?

Thanks

Siwko

I think you probably mean world coordinates instead of local correct? A single transformation matrix would be fastest I think. But for better readability, you might prefer to use a position vector and rotation vector. For the best readibility, but not best performance, you could use a position vector and Euler angles (watch out for gimbal lock though). I personally would likely choose the position vector and rotation matrix.

Originally posted by DFrey:
I think you probably mean world coordinates instead of local correct? A single transformation matrix would be fastest I think. But for better readability, you might prefer to use a position vector and rotation vector. For the best readibility, but not best performance, you could use a position vector and Euler angles (watch out for gimbal lock though). I personally would likely choose the position vector and rotation matrix.

Hmm… yeah, this sounds about along the lines of what I was just devising. Something akin to the following:

Store the “UP” vector of the object, possibly along with the angle about that vector the the “FRONT” vector lies.

Would that be difficult to convert to a rotation matrix? I don’t think so… but please correct me if I am wrong?

Basically, I like it because it drops me down to 4 floats worth of storage, and a very intuitive representation.

Also, I am assuming that I “MUST” store the angle to the front vector otherwise I don’t have full orientation data… correct? (ie: I know which was is up, but I don’t know which way I’m facing)

That would give me all three dimensions of orientation data, correct? If I were to neglect the angle, I’d have two dimensions of accuracy, but the third would be correct to +/-180 degrees… (top/bottom, left/right, front/back), depending on which axis I stored, right?

I really which I stayed with math in college now.

Thanks again

Siwko

Oh yeah… if I do store the UP vector and the angle, how do I go about generating the rotation matrix from it again? I have the papers on this somewhere, but I can’t find them!

Siwko