#### Archived

This topic is now archived and is closed to further replies.

# d3dim view matrix

This topic is 6927 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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);

##### Share on other sites
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.

##### Share on other sites
hmmmmmmmmm up = down with the view matrix.

1. 1
2. 2
3. 3
Rutin
13
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633700
• Total Posts
3013419
×