There are several ways of "hidden surface removal". The easiest way, and most appropriate for drawing convex polyhedron is the use of Backface culling. "Backface" will determine whether a surface (e.g. triangular face) is need to be drawn or not.
/-----------------------------------------------------------------------------------/
Draw3D routine:
triangle color-fill routine:
(*another version of using dsPIC hardware multiplier/divider is included in the download)
detect whether a triangle is facing backward.
Complete MPLAB+C30 project (dsPIC33FJ16GS504):
n6610lcd_3D_demo_part2.zip
Yorum Gönder