• ### What is your GameDev Story?

#### Archived

This topic is now archived and is closed to further replies.

This topic is 6331 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''m trying to get it so I can rotate my camera around so that I can look at my world. So, what I first tried doing was rotating the camera around the world x and y axis. I found out this didn''t work, because the rotations need to occur around the cameras own x and y axis for it to be correct. So I need some way to create rotation matrices about an arbitrary axis (namely the cameras x and y axis). Does anyone have a formula, or code, or know of a DX8 function that can do this? Thanks, Tom

##### Share on other sites
Matrix3::FromAxisAngle

at

http://www.magic-software.com/Source/Core3D/MgcMatrix3.cpp

[also in his book "3D Game Engine Design"]

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

##### Share on other sites
D3DXMatrixRotationAxis
Builds a matrix that rotates around an arbitrary axis.

D3DXMATRIX* D3DXMatrixRotationAxis(
D3DXMATRIX* pOut,
CONST D3DXVECTOR3* pV,
FLOAT Angle
);
Parameters
pOut
[in, out] Pointer to the D3DXMATRIX structure that is the result of the operation.
pV
[in] Pointer to the D3DXVECTOR3 structure that identifies the axis angle.
Angle
[in] Angle of rotation, in radians. Angles are measured clockwise when looking along the rotation axis toward the origin.

Microsoft saves the day

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 14
• 12
• 15
• 11
• 12
• ### Forum Statistics

• Total Topics
634153
• Total Posts
3015845
×