File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
content/posts/custom-3d-engine Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -243,14 +243,14 @@ Let's try now to fill the triangles ([bunny-6.py](bunny-6.py)):
243
243
![ ] ( bunny-6.png )
244
244
245
245
As you can see, the result is "interesting" and totally wrong. The problem is
246
- that the PolyCollection will draw the triangle in the order they are given
246
+ that the PolyCollection will draw the triangles in the order they are given
247
247
while we would like to have them from back to front. This means we need to sort
248
248
them according to their depth. The good news is that we already computed this
249
249
information when we applied the MVP transformation. It is stored in the new z
250
- coordinates. However, these z values are vertices based while we need to store
251
- triangles. We'll thus take the mean "z" value as being representative of the
250
+ coordinates. However, these z values are vertices based while we need to sort
251
+ the triangles. We'll thus take the mean z value as being representative of the
252
252
depth of a triangle. If triangles are relatively small and do not intersect,
253
- this will work beautifully:
253
+ this works beautifully:
254
254
255
255
```
256
256
T = V[:,:,:2]
You can’t perform that action at this time.
0 commit comments