Skip to main content
gamedev.net
🔒 Locked

Z problem !!!

Started by yanuart Jan 3, 2002 at 5:51 PM 0 replies 200+ views
Original Post
yanuart
yanuart
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 ??
Ride the thrill of your life
Play Motorama
S1CA
S1CA
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
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.