More Update on the Triangle
On the newer version i changed the code of the position of its view and place to make the triangle move in different cordinates. Here are some sample of the code :
D3DXVECTOR3 vEyePt( 0.0f, 3.0f, -10.0f ); //-10 is the view out = -5
D3DXVECTOR3 vLookatPt( fAngle, fAngle, fAngle );//moves it on the screen for view
D3DXVECTOR3 vUpVec( 0.0f, 1.0f, fAngle );//moving the triangle to move low and back up to the side
D3DXMATRIXA16 matView;
D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec );
g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView );
I also put comments to remember where i have changed the code for tips on making some more improvements.
UINT iTime = timeGetTime() % 1000;
FLOAT fAngle = iTime * (2.0f * D3DX_PI) / 900.0f;
//D3DXMatrixRotationY( &matWorld, fAngle ); //rotate only the x angle
D3DXMatrixRotationYawPitchRoll( &matWorld, 0.0f, 0.0f, 0.0f); //rotate the x or y angle of triangle view
g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
More
codes later.... Please comment.P.S. I have help from a classmate in case u see some duplicate codes.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home