Jump to content
  • Advertisement

Archived

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

yanuart

Z problem !!!

This topic is 6011 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

I''ve tried to load a mesh and then rotate it using SetTransform D3DTS_WORLTRANSFORM, it rotate well, but my mesh seems had been drawn the wrong way as the back showing up front. I''ve tried messing around with a variety of RenderState but the problem remains. What should I do ??

Share this post


Link to post
Share on other sites
Advertisement
Try changing the D3DRS_CULLMODE from D3DCULL_CCW to D3DCULL_CW.

The winding order of your vertices may be counterclockwise whereas it should be clockwise.

Alternatively your Z buffer may be having problems:

a) make sure the distance between the near and far clipping plane is something sensible (i.e. we use about far-near=4000 for most things). If it isn''t you''ll be getting artifacts from the Z buffer.

b) Make sure your Clear() call has the flag enabled to clear the Z buffer as well as the frame buffer.

c) Make sure ZENABLE=D3DZB, ZWRITEENABLE=TRUE etc.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!