MileZ

Wednesday, October 31, 2007

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.

posted by MileZ @ 8:52 AM   0 Comments

About Me

My Photo
Name: MileZ
Location: CA, United States

Amazing, so I heard, but interesting and one

View my complete profile

Links

  • Google News
  • Edit-Me
  • Edit-Me

Previous Posts

  • MY Kirby
  • Continue Anim8tor
  • The Anim8tor Projects
  • Last Year of Programming
  • New Project
  • Its George
  • What is that!?
  • Success!!!
  • The Cones and Sphere
  • The Amazing Cube Demo

Archives

  • October 2007
  • November 2007
  • December 2007
  • January 2008
  • August 2008
  • January 2009
  • February 2009
  • March 2009
  • August 2009
  • Current Posts

Powered by Blogger

Subscribe to
Posts [Atom]