PDA

View Full Version : Drawing a box in Direct3D


yakul
08-12-2007, 02:37 AM
I already have all the shaders, vertex decleration and mesh handling to draw a box. I succefully dawen regular meshs.
The problem is, I have a (-0.5, 0.5)x(-0.5, 0.5)x(-0.5, 0.5) box, and I want to scale it to some arbitrary dimensions box.
When I do so, the perspective of the box get distorted.
If I set the world in the WVP matrix to use:
D3DXMatrixRotationYawPitchRoll * D3DXMatrixScaling * D3DXMatrixTranslation
Then I get distortion of the box's shape on certain Yaw angles.
Why do I get this perspective hazard?

Thanks.

yakul
08-12-2007, 06:59 AM
I solved the problem, it was something simple.
The first thing I needed to do is scaling and not rotating, thats why I got a distorted box.