![]() This matrix should be composed of a rotation, scale and translation if it's the matrix used in directX to place the object in the world.Īnd scale is a diagonal matrix with scale factor in the diagonal. Is there some simplification about direction vector i dont know about? I spent a few hours trying to understand but i dont get it. Use Vector3D.Transform() for position vectors (but not world to body position transforms)įor direction vectors we use Vector3D.TransformNormal() and the world matrix.Ībout transforming world vector to Block local vector, why are you multiplying by the transposed matrix and not the inversed matrix? This matrix does not seems orthgonal so that M(-1)=M(T).Use Vector3D.TransformNormal() for direction vectors (velocity, acceleration, relative positions).(Note that the math above is for direction vectors) Vector transformations allow you to do cool things like convert a world velocity to a block relative local velocity! In Space Engineers, a transformation is simply a matrix-vector multiplication! Sounds pretty scary and complex, right? Nope! Now you may be asking "What the heck is a Transformation"? We can use this information to easily convert between body and world frames! (The 0's and the 1 in the last column are simply placeholders since Vrage's matrices need to be 4x4) The 4th row specifies the location of the body frame within the world frame. The first 3 rows of the World Matrix specify the orientation of the body's direction vectors in world space. To get this direction vector we simply subtract!Ī Space Engineers world matrix maps a vector from a block's body space to world space. Direction AB is a direction vector in the world frame that specifies the direction towards B from A. In this example, Position A and B are position vectors in the world frame. (Velocity and acceleration vectors are examples of this) Now let's clarify the difference between position vectors and direction vectors.Ī position vector defines a point in space that is measured from the origin of the coordinate system.Ī direction vector defines a specific direction. The origin of this body frame is free to translate in the world frame, and the local x, y, and z axes of the body frame can rotate relative to the stationary World frame. The GPS in-game uses the world frame for example.Ī Body frame is a coordinate system that is affixed to a particular body within the world frame. This is often called the " ground frame" in Earth based engineering applications. The origin does not move, nor do the X ,Y, or Z axes. ![]() The important coordinate frames that I will speak of come in 2 varieties:Ī World frame is a coordinate system that stays stationary. ![]() Vector transformations are a bit difficult to understand, so I figured I'd put together a little guide to help y'all use this incredibly helpful tool in your programs
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |