Archived

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

yanuart

Z problem !!!

Recommended Posts

yanuart    162
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
S1CA    1418
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