Skip to main content
gamedev.net
🔒 Locked

ZBuffer error perhaps???

Started by JohanL Jan 11, 2003 at 3:05 AM 6 replies 300+ views
Original Post
JohanL
JohanL
Folks, I''m having some difficulties in figuring out what''s wrong with my code.. I''m using Smurfwow''s code (posted earlier in MD2 topics) to load a MD2 model and render it on screen, however when I render this image I get the following result. As you can see the left arm gets drawn over the back which shouldn''t happen, I thought at first that this had something to do with the z-buffer being disabled but according to my code that shouldn''t be, I am enabling it earlier... Anyone got a clue? Regards JohanL
Jerimiah
Jerimiah
Can''t see the image... but smurfs original code had the triangles wound the wrong way around - try the change I posted in the same thread to reverse the triangles and see if thats what your problem is
JohanL
JohanL
I''ve tried that solution without success, I hope I understood it correctly that I just made sure that vertex 0 -> 2 and 2 -> 0 in the loading function.

When I analyze the picture further the error seems only to apply to the arms of the MD2 model, they are always drawn on the wrong side?!?!?

Confusing, isn''t it...

Regards

JohanL
Jerimiah
Jerimiah
I can''t see the picture - can you just post a link to it?
JohanL
JohanL
http://groups.msn.com/johanlindfors@hotmail.com/Dokument/Error.jpg

Doesn''t that work?

Regards

JohanL
JohanL
JohanL
I''m still seing this problem, just as if I have a inverted Z-buffer, everything gets drawn front to back...

Anyone know what this can come from or have any clues whatsoever on solutions?

Regards

JohanL
Jerimiah
Jerimiah
Can''t see your picture - it isn''t publicly visible.... I''m guessing you have to be logged into yahoo to see it.

I still think it''s probably your vertex order winding the wrong way - did you make the change exactly as I put it (a few posts down from smurfs code? Alternatively just to check you could reverse your cullmode ....
JohanL
JohanL
I read the posts but all I saw was that you''ve done a "hack" in rearranging the vertices, I''ve tried that without luck, and I''ve also tried different culling methods, no changes...

Well, it''s late evening here in Sweden now, time to get some sleep and maybe tomorrow the solution will be clearer, too tired


Regards

JohanL

Topic Locked

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

Sign in to reply to this topic.