Rotation very simple ?
have some code like the following:
D3DXMatrixScaling( &matScale, 1.0f, 1.00f, 1.00f );
D3DXMatrixTranslation( &matTranslate, fObjectPosX, fObjectPosY, fObjectPosZ );
D3DXMatrixRotationZ( &matSpin, fTime/1000);
D3DXMatrixMultiply( &plane.matLocal, &matScale, &matTranslate);
D3DXMatrixMultiply( &plane.matLocal, &matSpin, &plane.matLocal);
g_pd3dDevice->SetTransform( D3DTS_WORLD, &plane.matLocal);
what i''m interested is in the Rotation about the Z, I can get the object to rotate a constant speed and then have that speed increasing when i press a key but after you relase the key it goes back to the original constant speed it was rotating at. I want to be able to accelerate it to a speed and have it stay there. It''s been a few months since i''ve done any programming so i''m extreamly rusty.
I may have misunderstood your question, but you should probably be increasing your angle by the spin speed:
Given that the Angle should be between 0 and 2 * 3.14159.
If you press a key increase your spin speed.
[edited by - sdoherty55 on June 23, 2002 2:10:48 PM]
m_fAngle+=m_fSpinSpeed;D3DXMatrixRotationZ( &matSpin, m_fAngle);
Given that the Angle should be between 0 and 2 * 3.14159.
If you press a key increase your spin speed.
[edited by - sdoherty55 on June 23, 2002 2:10:48 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement