Jump to content


Drawing a box in Direct3D


1 reply to this topic

#1 yakul

    Member

  • Members
  • PipPip
  • 55 posts

Posted 12 August 2007 - 09: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.

#2 yakul

    Member

  • Members
  • PipPip
  • 55 posts

Posted 12 August 2007 - 01:59 PM

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users