http://img85.imagesh...3561/tridir.jpg
what i want todo is translate an object in the direction the face is facing , heres the code i already have
D3DXMatrixRotationY(&Rot,Amount);
d3ddev->SetTransform(D3DTS_WORLD,&Rot);
D3DXVec3TransformCoord(&TriVert1Out,&TriVert1,&Rot);
D3DXVec3TransformCoord(&TriVert2Out,&TriVert2,&Rot);
D3DXVec3TransformCoord(&TriVert3Out,&TriVert3,&Rot);
D3DXVECTOR3 Sub1 = TriVert1Out - TriVert2Out;
D3DXVECTOR3 Sub2 = TriVert1Out - TriVert3Out;
D3DXVECTOR3 Cross;
D3DXVec3Cross(&Cross,&Sub1,&Sub2);
D3DXVec3Normalize(&Cross,&Cross);
RECT textbox;
SetRect(&textbox, 0, 0, 640, 480);
sprintf(Buffer,"%s %f %f %f\n","The triangle's direction is",Cross.x,Cross.y,Cross.z);
dxfont->DrawTextA(NULL,
Buffer,
strlen(Buffer),
&textbox,
NULL,
D3DCOLOR_ARGB(255, 255, 0, 0));
so next i want to say use D3DXMatrixTranslation on a box and make the box fire outwards from the direction the face is facing, i am not sure how to make the box keep moving in that diagonal path thats the direction etc...
can anyone help?












