Rotation very simple ?

Started by
0 comments, last by Scooter 21 years, 10 months ago
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.
We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
Advertisement
I may have misunderstood your question, but you should probably be increasing your angle by the spin speed:


    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