Tuesday, May 6, 2008

Z-Buffering & Z-Sorting

Sometimes a picture can be worth a 1000 words:


And sometimes it isn't... I'm going to try to upload an applet so you guys can drag the cube around and see it rotating =).

Right now I'm trying to fix some things like:

This is caused by the over simplistic algorithm called z-sorting where you sort the triangles which make up the object by the average depth of it's 3 vertices (points) and then draw them from farthest to nearest.

Ill try to fix this by implementing z-buffering, or testing the depth of each pixel I draw and checking if it's going to be drawn onto a deeper pixel, if it is, I'll draw it, otherwise, I won't.

So my current ToDo list looks like this:
1. Upload applet
2. Fix z-buffering/z-sorting issue

No comments: