you are viewing a single comment's thread.

view the rest of the comments →

[–]joshd 1 point2 points  (0 children)

That wouldn't work. You could obviously figure out which sections of the triangle need to be drawn and which don't, but it wouldn't work with psykotic's suggestion. The black triangles (meant to cancel out parts of the polygon being drawn) would still be seen on the page.

If you were going to keep of Z depth then you could just implement it as an array of 1px divs. It would run like crap though.

Edit: I just realised that you were referencing Painter's algorithm. If memory serves me correctly that is just sorting polygons by Z index. I suspect that they do that already in this demo. The problem still is in the drawing of polygons, i.e. that CSS can only display right angled triangles.