NecroDOME
17-02-2005, 04:10 PM
Hi there,
Im trying to rotate my camera (yaw, pitch and roll). I found this code snippet in the internet somewhere:
// Genenerate a quaternion, using only the yaw from the player
D3DXQuaternionRotationYawPitchRoll( &quat, cameraRotationYaw, 0.0f, 0.0f );
// Now build the matrix
D3DXMatrixAffineTransformation( &matOrientation, 1.25f, NULL, &quat, &cameraPosition );
// We must take the inverse to get the appropriate transformation
D3DXMatrixInverse( &matView, NULL, &matOrientation );
I translated it to
D3DXQuaternionRotationYawPitchRoll(Quat, Rotation.x, Rotation.y, Rotation.z);
D3DXMatrixAffineTransformation(matPos, 1.0, nil, Quat, Position);
D3DXMatrixInverse( matView, nil, matPos );
When I translate it te delphi I got an compiler error:
Incompatible types 'TD3DXQuarternion' and 'PD3DXQuarternion'
can anyone tell me how I translate TD3DXQuarternion to PD3DXQuarternion
(error is given on the Quat, witch is a TD3DXQuarternion in D3DXQuaternionRotationYawPitchRoll, and D3DXMatrixAffineTransformation needs a PD3DXQuarternion)
Could anyone help me with this ? Plzkthx
Im trying to rotate my camera (yaw, pitch and roll). I found this code snippet in the internet somewhere:
// Genenerate a quaternion, using only the yaw from the player
D3DXQuaternionRotationYawPitchRoll( &quat, cameraRotationYaw, 0.0f, 0.0f );
// Now build the matrix
D3DXMatrixAffineTransformation( &matOrientation, 1.25f, NULL, &quat, &cameraPosition );
// We must take the inverse to get the appropriate transformation
D3DXMatrixInverse( &matView, NULL, &matOrientation );
I translated it to
D3DXQuaternionRotationYawPitchRoll(Quat, Rotation.x, Rotation.y, Rotation.z);
D3DXMatrixAffineTransformation(matPos, 1.0, nil, Quat, Position);
D3DXMatrixInverse( matView, nil, matPos );
When I translate it te delphi I got an compiler error:
Incompatible types 'TD3DXQuarternion' and 'PD3DXQuarternion'
can anyone tell me how I translate TD3DXQuarternion to PD3DXQuarternion
(error is given on the Quat, witch is a TD3DXQuarternion in D3DXQuaternionRotationYawPitchRoll, and D3DXMatrixAffineTransformation needs a PD3DXQuarternion)
Could anyone help me with this ? Plzkthx