This invention relates to an information processing apparatus, an information processing method and a transmission medium, and more particularly to an information processing apparatus, an information processing method and a transmission medium which are adapted to interpolate at least three attitudes or more of object to thereby improve degree of freedom of rotational operation of the object.
In information processing apparatuses such as computer game machine, etc., objects of various shapes (polygons) can be represented as two-dimensional graphic or three-dimensional graphic to change, within three-dimensional virtual space, corresponding objects so as to take various states, i.e., to allow them to carry out animation.
In order to change a predetermined object from a predetermined attitude to another attitude within the three-dimensional virtual space, it is sufficient to rotate it by a predetermined angle with a predetermined axis being as center. As a method of carrying out processing to rotate such object with an arbitrary axis being as center, there has been proposed a method disclosed in, e.g., the Japanese Laid Open Application No. 315171/1996 publication. In accordance with the method disclosed in this publication, such an approach is employed as shown in FIG. 7 to determine reference attitude (angle) A of an object 201, rotated attitude (target attitude) B thereof and a predetermined axis of rotation 202 to determine, on the assumption that the object 201 rotates within the range of 0 to xcex8 around (about) the rotation axis with the rotation axis being as center, rotation angle xcex8d of object interpolated within such a range to determine interpolation rotation matrix Rd by using the rotation angle xcex8d. A further approach is employed to dissolve the determined interpolation rotation matrix Rd into angle data around respective axes of X-axis, Y-axis and Z-axis of the three-dimensional coordinate system thus to calculate interpolation data.
Explanation will now be given in connection with a method of determining rotation matrix when a predetermined object rotates from a reference attitude with an arbitrary axis being as center. Rotation around (about) the origin of the three-dimensional coordinate system is represented by rotation matrix of 3xc3x973. When it is now assumed that the coordinate system B is the coordinate system in which the coordinate system A is rotated by rx degrees around the X-axis, is rotated by ry degrees around the Y-axis and is rotated by rz degrees around the Z-axis in order, the rotation matrix R is represented by the following formula (1).                     R        =                              (                                                                                cos                    ⁡                                          (                      rz                      )                                                                                                            -                                          sin                      ⁡                                              (                        rz                        )                                                                                                              0                                                                                                  sin                    ⁡                                          (                      rz                      )                                                                                                            cos                    ⁡                                          (                      rz                      )                                                                                        0                                                                              0                                                  0                                                  1                                                      )                    ⁢                      (                                                                                cos                    ⁡                                          (                      ry                      )                                                                                        0                                                                      sin                    ⁡                                          (                      ry                      )                                                                                                                    0                                                  1                                                  0                                                                                                  -                                          sin                      ⁡                                              (                        ry                        )                                                                                                              0                                                                      cos                    ⁡                                          (                      ry                      )                                                                                            )                    ⁢                      (                                                            1                                                  0                                                  0                                                                              0                                                                      cos                    ⁡                                          (                      rx                      )                                                                                                            -                                          sin                      ⁡                                              (                        rx                        )                                                                                                                                          0                                                                      sin                    ⁡                                          (                      rx                      )                                                                                                            cos                    ⁡                                          (                      rx                      )                                                                                            )                                              (        1        )            
It is further assumed that this formula (1) is represented by the formula (2) expressed below.                     R        =                  (                                                                      R                  11                                                                              R                  12                                                                              R                  13                                                                                                      R                  21                                                                              R                  22                                                                              R                  23                                                                                                      R                  31                                                                              R                  32                                                                              R                  33                                                              )                                    (        2        )            
In this case, transposed matrix RT of this rotation matrix R is represented by the formula (3) expressed below.                                                                         R                T                            =                              xe2x80x83                            ⁢                              (                                                                                                    R                        11                                                                                                            R                        21                                                                                                            R                        31                                                                                                                                                R                        12                                                                                                            R                        22                                                                                                            R                        32                                                                                                                                                R                        13                                                                                                            R                        23                                                                                                            R                        33                                                                                            )                                                                                        =                              xe2x80x83                            ⁢                                                (                                                                                    1                                                                    0                                                                    0                                                                                                            0                                                                                              cos                          ⁡                                                      (                            rx                            )                                                                                                                                                sin                          ⁡                                                      (                            rx                            )                                                                                                                                                              0                                                                                              -                                                      sin                            ⁡                                                          (                              rx                              )                                                                                                                                                                            cos                          ⁡                                                      (                            rx                            )                                                                                                                                )                                ⁢                                  (                                                                                                              cos                          ⁡                                                      (                            ry                            )                                                                                                                      0                                                                                              -                                                      sin                            ⁡                                                          (                              ry                              )                                                                                                                                                                                          0                                                                    1                                                                    0                                                                                                                                      sin                          ⁡                                                      (                            ry                            )                                                                                                                      0                                                                                              cos                          ⁡                                                      (                            ry                            )                                                                                                                                )                                                                                                                        xe2x80x83                            ⁢                              (                                                                                                    cos                        ⁡                                                  (                          rz                          )                                                                                                                                    sin                        ⁡                                                  (                          rz                          )                                                                                                            0                                                                                                                          -                                                  sin                          ⁡                                                      (                            rz                            )                                                                                                                                                              cos                        ⁡                                                  (                          rz                          )                                                                                                            0                                                                                                  0                                                              0                                                              1                                                                      )                                                                        (        3        )            
In this case, since the formula expressed below holds,
RTR=1xe2x80x83xe2x80x83(4)
this rotation matrix R is orthogonal matrix. Conversely, orthogonal matrix where |R|=1 is represented by the formula (4). This matrix is rotation matrix. Generally, it is known that the orthogonal matrix can be normalized as indicated below by using other orthogonal matrix T.                                           T                          -              1                                ⁢          RT                =                  (                                                    1                                            0                                            0                                                                    0                                                              cos                  ⁢                                      xe2x80x83                                    ⁢                  θ                                                                              sin                  ⁢                                      xe2x80x83                                    ⁢                  θ                                                                                    0                                                                                  -                    sin                                    ⁢                                      xe2x80x83                                    ⁢                  θ                                                                              cos                  ⁢                                      xe2x80x83                                    ⁢                  θ                                                              )                                    (        5        )            
When arbitrary two rotation matrices A, B exist, R is put (represented) as the following formula (6).
R=Axe2x88x921Bxe2x80x83xe2x80x83(6)
When this formula (6) is used, the above mentioned formula (5) can be expressed as below.                                           T                          -              1                                ⁢                      A                          -              1                                ⁢          BT                =                  (                                                    1                                            0                                            0                                                                    0                                                              cos                  ⁢                                      xe2x80x83                                    ⁢                  θ                                                                              sin                  ⁢                                      xe2x80x83                                    ⁢                  θ                                                                                    0                                                                                  -                    sin                                    ⁢                                      xe2x80x83                                    ⁢                  θ                                                                              cos                  ⁢                                      xe2x80x83                                    ⁢                  θ                                                              )                                    (        7        )            
When rotation matrix B is determined from this formula (7), it is represented by the formula (8) expressed below.                     B        =                              AT            ⁡                          (                                                                    1                                                        0                                                        0                                                                                        0                                                                              cos                      ⁢                                              xe2x80x83                                            ⁢                      θ                                                                                                  sin                      ⁢                                              xe2x80x83                                            ⁢                      θ                                                                                                            0                                                                                                      -                        sin                                            ⁢                                              xe2x80x83                                            ⁢                      θ                                                                                                  cos                      ⁢                                              xe2x80x83                                            ⁢                      θ                                                                                  )                                ⁢                      T                          -              1                                                          (        8        )            
In this case, when angle is changed within the range from 0 to xcex8, the previously described coordinate system (attitude) represented by A rotates around (about) a predetermined axis, resulting in coordinate system (attitude) of B. When orthogonal matrix of T is found out in this way, interpolation can be made between arbitrary two coordinate systems by rotation around (about) certain one rotation axis.
A method of finding out this orthogonal matrix T will now be described. Let find out vector which is eigen (intrinsic) vector of rotation matrix R, which satisfies the following relational expression, and has absolute value of 1.
Rt=txe2x80x83xe2x80x83(9)
When E is now assumed to be unit matrix, the following relational expression holds.
(Rxe2x88x92E)t=0xe2x80x83xe2x80x83(10)
Accordingly, t is orthogonal to component vector of matrix (Rxe2x88x92E).
Further, linearly independent two (sets of) vectors of the matrix (Rxe2x88x92E) are found out to provide outer product thereof. This vector is normalized. The normalized vector thus obtained is assumed to be t1. Then, vector orthogonal to t1 is found out. As this vector, either one of vectors of matrix (Rxe2x88x92E) which generates t1 may be used. This vector is also normalized. The normalized vector thus obtained is assumed to be t2. Then, outer product of t1 and t2 is provided. The vector thus obtained is assumed to be t3. Since these t1 to t3 all have absolute values of 1 and are orthogonal to each other, matrix (t1 t2 t3) is orthogonal matrix.
Assuming now that the matrix (t1 t2 t3) is orthogonal matrix T, the left side of the formula (5) can be represented as the formula (11) indicated below.                                                                                           T                                      -                    1                                                  ⁢                RT                            =                                                                    (                                                                                                                        t                            1                                                                                                                                t                            2                                                                                                                                t                            3                                                                                                                )                                                        -                    1                                                  ⁢                                  R                  ⁡                                      (                                                                                                                        t                            1                                                                                                                                t                            2                                                                                                                                t                            3                                                                                                                )                                                                                                                          =                                                (                                                                                                              t                          1                          T                                                                                                                                                              t                          2                          T                                                                                                                                                              t                          3                          T                                                                                                      )                                ⁢                                  xe2x80x83                                ⁢                                  R                  ⁡                                      (                                                                                                                        t                            1                                                                                                                                t                            2                                                                                                                                t                            3                                                                                                                )                                                                                                                          =                              (                                                                                                                              t                          1                          T                                                ⁢                                                  Rt                          1                                                                                                                                                              t                          1                          T                                                ⁢                                                  Rt                          2                                                                                                                                                              t                          1                          T                                                ⁢                                                  Rt                          3                                                                                                                                                                                                  t                          2                          T                                                ⁢                                                  Rt                          1                                                                                                                                                              t                          2                          T                                                ⁢                                                  Rt                          2                                                                                                                                                              t                          2                          T                                                ⁢                                                  Rt                          3                                                                                                                                                                                                  t                          3                          T                                                ⁢                                                  Rt                          1                                                                                                                                                              t                          3                          T                                                ⁢                                                  Rt                          2                                                                                                                                                              t                          3                          T                                                ⁢                                                  Rt                          3                                                                                                                    )                                                                        (        11        )            
In this case, t1 to t3 can be represented by the formula (12) expressed below by using the formula (9).
t1TRt1=t1Tt1
t2TRt1=t2Tt1
t3TRt1=t3Tt1xe2x80x83xe2x80x83(12)
By using these relational expressions, the formula (11) can be represented by the formula (13) expressed below.                                           T                          -              1                                ⁢          RT                =                  (                                                    1                                            0                                            0                                                                    0                                                                                  t                    2                    T                                    ⁢                                      Rt                    2                                                                                                                    t                    2                    T                                    ⁢                                      Rt                    3                                                                                                      0                                                                                  t                    3                    T                                    ⁢                                      Rt                    2                                                                                                                    t                    3                    T                                    ⁢                                      Rt                    3                                                                                )                                    (        13        )            
Then, respective elements (components) of the formula (13) are put as indicated by the formula (14) expressed below.                                           T                          -              1                                ⁢          RT                =                  (                                                    1                                            0                                            0                                                                    0                                            A                                            B                                                                    0                                            C                                            D                                              )                                    (        14        )            
In this case, since T and R are both orthogonal matrices, Txe2x88x921RT is also orthogonal matrix. The following relational expressions hold.
A2+C2=1xe2x80x83xe2x80x83(15)
B2+D2=1xe2x80x83xe2x80x83(16)
A2+B2=1xe2x80x83xe2x80x83(17)
C2+D2=1xe2x80x83xe2x80x83(18)
AB+CD=0xe2x80x83xe2x80x83(19)
AC+BD=0xe2x80x83xe2x80x83(20)
ADxe2x88x92BC=1xe2x80x83xe2x80x83(21)
Subtraction of the formula (18) from the formula (15) gives
A2xe2x88x92D2=0, A=xc2x1D
Further, when A=xe2x88x92D, substitution thereof into the formula (19) gives
D(Cxe2x88x92B)=0
Thus, D=0 or B=C. Substitution of D=0 into the formula (21) gives
xe2x88x92BC=1
Further, subtraction of the formula (17) from the formula (15) gives
B=xc2x1C
Thus, the following relational expression is obtained.
B=xe2x88x92C=xc2x11
On the other hand, substitution of A=xe2x88x92D, B=C into the formula (21) gives
xe2x88x92D2xe2x88x92C2=1
This is contradictory. Therefore, the following relational expression is obtained.
A=D=0, B=xe2x88x92C=xc2x11
Now, when A=D, substitution of this relational expression into the formula (19) gives
D(B+C)=0
Thus, D=0 or B=xe2x88x92C is obtained.
When D=0, the relational expression B=xe2x88x92C=xc2x11 is similarly obtained.
Further, when Dxe2x89xa00, B=xe2x88x92C. Therefore, in either case, the following relational expressions are obtained.
A=D
B=xe2x88x92C
xe2x80x83C2+D2=1
Thus, the above-mentioned formula (5) holds.
In this way, the orthogonal matrix T which satisfies the formula (5) can be found out. Further, rotation matrix Rd when rotation is made by rotation angle xcex8d from the reference attitude with an arbitrary axis being as center can be determined from the formula (5) in a manner indicated below.   Rd  =            T      ⁡              (                                            1                                      0                                      0                                                          0                                                      cos                ⁢                                  xe2x80x83                                ⁢                θ                ⁢                                  xe2x80x83                                ⁢                d                                                                    sin                ⁢                                  xe2x80x83                                ⁢                θ                ⁢                                  xe2x80x83                                ⁢                d                                                                        0                                                                        -                  sin                                ⁢                                  xe2x80x83                                ⁢                θ                ⁢                                  xe2x80x83                                ⁢                d                                                                    cos                ⁢                                  xe2x80x83                                ⁢                θ                ⁢                                  xe2x80x83                                ⁢                d                                                    )              ⁢          T              -        1            
By using such a method, interpolation processing with respect to rotation of object is carried out.
However, in the conventional interpolation processing with respect to rotation of object, since interpolation is carried out only between two points (two attitudes), limitation takes place in the degree of freedom of motion (movement) of object. As a result, it is difficult to realize natural (smooth) change of attitude.
In addition, operation (computation) of the rotation matrix becomes complicated as described above.
This invention has been proposed in view of such circumstances and its object is to provide a novel information processing apparatus, a novel information processing method and a novel transmission medium which are capable of improving degree of freedom of rotation operation of object.
An information processing apparatus according to this invention comprises: selector means for selecting, as reference attitude, any one of prepared plural attitudes of an object; first generating means for generating vectors serving as respective rotation axes for changing the reference attitude selected by the selector means into at least two other attitudes or more; first calculating means for calculating rotation angles when the object is changed from the reference attitude to the other attitudes with the vectors generated by the first generating means being as rotation axes; converting means for converting lengths of the vectors into lengths corresponding to the rotation angles calculated by the first calculating means; second generating means for synthesizing the vectors of which lengths are converted by the converting means to generate interpolation vector; second calculating means for calculating length of the interpolation vector generated by the second generating means; and third generating means for rotating the reference attitude of the object by angle corresponding to the length calculated by the second calculating means with the interpolation vector being as rotation axis to generate target attitude.
Moreover, an information processing method according to this invention comprises: a selection step of selecting, as reference attitude, any one of prepared plural attitudes of an object; a first generation step of generating vectors serving as respective rotation axes for changing the reference attitude selected by the selection step into at least two other attitudes or more; a first calculation step of calculating rotation angles when the object is changed from the reference attitude to the other attitudes with the vectors generated at the first generation step being as rotation axes; a conversion step of converting lengths of the vectors into lengths corresponding to the rotation angles calculated at the first calculation step; a second generation step of synthesizing the vectors of which lengths are converted at the conversion step to generate interpolation vector; a second calculation step of calculating length of the interpolation vector generated at the second generation step; and a third generation step of rotating the reference attitude of the object by angle corresponding to the length calculated at the second calculation step with the interpolation vector being as rotation axis to generate target attitude.
Further, a transmission medium according to this invention is adapted so that computer program is caused to undergo transmission, the computer program including: a selection step of selecting, as reference attitude, any one of prepared plural attitudes of an object; a first generation step of generating vectors serving as respective rotational axes for changing the reference attitude selected by the selection step into at least two other attitudes or more; a first calculation step of calculating rotation angles when the object is changed from the reference attitude to the other attitudes with the vectors generated at the first generation step being as rotation axes; a conversion step of converting lengths of the vectors into lengths corresponding to the rotation angles calculated at the first calculation step; a second generation step of synthesizing the vectors of which lengths are converted at the conversion step to generate interpolation vector; a second calculation step of calculating length of the interpolation vector generated at the second generation step; and a third generation step of rotating the reference attitude of the object by angle corresponding to the length calculated at the second calculation step with the interpolation vector being as rotation axis to generate target attitude.
In the information processing apparatus, the information processing method and the transmission medium according to this invention, any one of prepared plural attitudes of object is selected as reference attitude. Vectors serving as respective rotation axes for changing the selected reference attitude into at least two other attitudes or more are generated. Rotation angles when the object is changed from the reference attitude to the other attitudes with the generated vectors being as rotation axes. Lengths of the vectors are converted into lengths corresponding to the rotational angles. The vectors of which lengths are converted are synthesized so that interpolation vector is generated. Length of the generated interpolation vector is calculated. The reference attitude of the object is rotated by angle corresponding to the calculated length with the interpolation vector being as rotation axis. Thus, target attitude is generated.