hi, im new to directx, and im playing with some matrix transformations.
currently, i have an object rotating in a world, and the camera implemented.
The problem, is that the whole world rotates along with the camera.
this is a sample
g3D->setViewMatrix( gCamera ); /*set the new view and look at for the camera*/
g3D->begin(); /* Begin the scene*/
g3D->clear(); /* Clear viewport*/
DrawGrid( CPos(0,-2,0), 32, D3DCOLOR_ARGB(255,255,0,0) ); /*draw the floor of the world*/
D3DXMATRIX wMatrix;
D3DXMatrixRotationZ(&wMatrix, DEG2RAD(angle)); /* rotate the obj around z*/
g3D->setWorldMatrix(&wMatrix); /* Set our world transformation (call setTransform(D3DTS_WORLD, matrix)*/
DrawTriangle(); /* Draw a triangle*/
g3D->end(); /* End the scene */
that works almost fine, except that instead of rotating only the triangle, it rotates everything.
In OpenGL, i used to do something like this to only affect the objects that i want:
glPushMatrix() /*save the matrix state*/
glRotate(x,y,z,angle); /* rotate the objects to draw*/
draw() /*draw something*/
glPopMatrix(); /* finish working with that matrix*/
what would be the equivalent in dx?
thanks a lot..