|
|
发表于 2007-5-28 00:51:00
|
显示全部楼层
Re:难道学3D游戏开发就必须学四元数吗?
不好理解,ms单位四元数可以表示超球面空间的一个点(和6楼的那个有什么联系呢?不过这个应该和宇宙模型有联系)
不深入不行……
不过在原理清楚之前可以硬着头皮用[em7]
Think of a person standing on the surface of a big sphere (like a planet)
From the person’s point of view, they can move in along two orthogonal axes (front/back) and (left/right)
There is no perception of any fixed poles or longitude/latitude, because no matter which direction they face, they always have two orthogonal ways to go
From their point of view, they might as well be moving on a infinite 2D plane, however if they go too far in one direction, they will come back to where they started!
Now extend this concept to moving in the hypersphere of unit quaternions
The person now has three orthogonal directions to go
No matter how they are oriented in this space, they can always go some combination of forward/backward, left/right and up/down
If they go too far in any one direction, they will come back to where they started
Now consider that a person’s location on this hypersphere represents an orientation
Any incremental movement along one of the orthogonal axes in curved space corresponds to an incremental rotation along an axis in real space (distances along the hypersphere correspond to angles in 3D space)
Moving in some arbitrary direction corresponds to rotating around some arbitrary axis
If you move too far in one direction, you come back to where you started (corresponding to rotating 360 degrees around any one axis)
A distance of x along the surface of the hypersphere corresponds to a rotation of angle 2x radians
This means that moving along a 90 degree arc on the hypersphere corresponds to rotating an object by 180 degrees
Traveling 180 degrees corresponds to a 360 degree rotation, thus getting you back to where you started
This implies that q and -q correspond to the same orientation
Consider what would happen if this was not the case, and if 180 degrees along the hypersphere corresponded to a 180 degree rotation
This would mean that there is exactly one orientation that is 180 opposite to a reference orientation
In reality, there is a continuum of possible orientations that are 180 away from a reference
They can be found on the equator relative to any point on the hypersphere
Also consider what happens if you rotate a book 180 around x, then 180 around y, and then 180 around z
You end up back where you started
This corresponds to traveling along a triangle on the hypersphere where each edge is a 90 degree arc, orthogonal to each other edge |
|