Well, continue learning mathematics...
In 3D programs, quaternion is usually used to calculate the Rotation Angle of 3D objects. Compared with matrix, quaternion is more efficient, occupies less storage space, and facilitates interpolation. In mathematics, quaternion indicates the plural W + Xi + YJ + ZK, where I, j, and K are all virtual units:
I * I = J * j = K * k =-1
I * j = K, J * I =-K
Quaternion can be considered as a scalar and a combination of 3D vectors. The real part W indicates a scalar, and the virtual part indicates that the vector is markedV, Or three independent components (x, y, z ). Therefore, quaternion can be recorded as [W,V] Or [W, (x, y, X)]. The biggest misunderstanding of quaternion is that w represents the rotation angle,VRotation Axis. Correct understanding is that W is related to the rotation angle, and V is related to the rotation axis. For example, to represent a vectorNIt is an axis and the degree of axis rotation α. The relative quaternion should be:
Q = [cos (α/2), sin (α/2)N]
= [Cos (α/2), (SINA (α/2)NX, sin (α/2)NY, sin (α/2)NZ)]
GenerallyNUnit vector. For quaternion, four values can be used to record rotation, rather than the sixteen values required by matrix. Why is it convenient to use quaternion to calculate rotation? First, quaternion is a plural number. If you still remember a little complex number knowledge, you should know that the geometric meaning of the plural multiplication (Cross multiplication) is actually to rotate the plural number. For the simplest plural P = x + yi, if it is multiplied by another plural Q = (con α, sin α), P is rotated counterclockwise:
P' = PQ
Of course, the form of X + yi can only represent 2D transformations. for 3D transformations, quaternion needs to be used, and the computation must be more complex. To rotate a vertex P (x, y, z) in a 3D space, convert it to the quaternion Form P = [0, (x, y, z)], as discussed earlier, q = cos (α/2), sin (α/2)NTo rotate quaternion, hereNIt is the rotation axis of the unit vector length, and α is the rotation angle. Then the point P after rotation is:
P' = qpq-1
PS: bold letters indicate Vectors
~~~~~~~~~~~~~~~~~~~~~~~ Dull split line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Yesterday, I played the ancient scroll 4-annihilate, a good game with exquisite pictures and various special effects. In particular, the tree rendering in it is the best I have ever seen, unfortunately, my 6600gt has been a little difficult to run>. <. However, the most unaccustomed thing is game operations. The visual and mobile rotation control methods make me dizzy for an hour, especially the direction control after riding a horse, which can only be described as difficult. In contrast, the wow operation is much more comfortable. In addition, there is another unpleasant thing. Although the game can be customized in detail at the beginning, it is a pity that most games can only see the back of the character. To be honest, the figures are really ugly. I chose the female genie, but it looks like a hunchback-_-B from the back. In addition, the skill bar is extremely inconvenient to use. Only one key can be used to release the magic, which is troublesome to switch between multiple magic keys. After all, it is a PC version. Compared with the PS or Xbox version, you can completely improve the control mode. I think of the idea that two mouse clicks are used to separate the perspective and accuracy of the FPS game from the gameres forum a few days ago. In fact, good human-computer interaction is much more important than some flashy functions. Of course, some people may say that special control is also one of the attractions of a game. But don't you think it's a better solution to provide gamers with multiple optional visual control methods like the winter nights? So, the conclusion is that we should not destroy a good game with an unreasonable UI.
The csdn blog seems to have a problem, so you cannot upload images -_-.