• Advertisement


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

Calculating pos-vector for skybox - I get mad ...

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, I got a strange problem with that topic. I have a skybox rendered like that:
D3DXMatrixTranslation(&world_mat, camera.vPos.x, camera.vPos.y, camera.vPos.z);
directx.device->SetTransform(D3DTS_WORLD, &world_mat);
The camera-moves are calculated like that:
   vPos.x += vRight.x * fX;
   vPos.y += vRight.y * fX;
   vPos.z += vRight.z * fX;

   vPos.x += vUp.x * fY;
   vPos.y += vUp.y * fY;
   vPos.z += vUp.z * fY;

   vPos.x += vDir.x * fZ;
   vPos.y += vDir.y * fZ;
   vPos.z += vDir.z * fZ;
So, if I set number-constants like the following, everything is alright. The box got positioned in the center and it gots its normal sidelenght. (for example 1.0 from vertex to vertex)
D3DXMatrixTranslation(&world_mat, 0, 0, 0);
If I set 100, 100, 100 as parameters for the translation, also everything is as it has to be. The box moves 100 in each direction. But if I set the code I first posted, with the coords of my camera, wich are the three values of a vector, the box gets to big. Much to big. The position is right, but it is rendered for two or more games .. Anyone got any idea? I''m lost .... :-) Python

Share this post

Link to post
Share on other sites

  • Advertisement