🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

d3dim view matrix

Started by
1 comment, last by GameDev.net 24 years, 6 months ago
this is what oiim doing........


D3DMATRIX vm = identitymatrix; //view matrix
D3DMATRIX tvm; // temporary view matrix
int cang; // camera angle

if (cam[6]) cang++;
if (cam[7]) cang--;

RotY(vm, rad(cang)); //rotate view around y axis

pd3dDevice->GetTransform(D3DTRANSFORMSTATE_VIEW, &tvm);

vm._41 = tvm._41;
vm._42 = tvm._42;
vm._43 = tvm._43;

if (cam[0]) vm._42-=1.f;//=10.f;
if (cam[1]) vm._42+=1.f;
if (cam[2]) vm._41+=1.f;
if (cam[3]) vm._41-=1.f;
if (cam[4] && (vm._43> -100.f)) vm._43-=1.f;
if (cam[5]) vm._43+=1.f;


pd3dDevice->SetTransform(D3DTRANSFORMSTATE_VIEW, &vm);

Advertisement
is the you translate and rotate the view matrix and the world matrix different?

im trying to make the view work like a fps, so that the camera rotates around its origin or from where it is at but it just rotates around the world's orgin.

how do i make the view rotate around the position it is at? i rotate an identity matrix and set the _41 _42 _43 to the position then settransform the view but it still rotates around the origin.

hmmmmmmmmm up = down with the view matrix.

This topic is closed to new replies.

Advertisement