Tuesday, December 14, 2010

N6610 LCD 3D Demo Part II

Instead of drawing only the edges of a polyhedron, this time we draw the faces and 'fill' it with corresponding colors. This demo now uses a dsPIC (16-bit and 40MIPS core) for "faster" and "smoother" graphics in the N6610/N6100 LCD (w/ pcf8833 controller). See "lcd6610.h" for the used pinouts.



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


Wednesday, December 8, 2010

N6610 LCD 3D Demo

Nokia 6610/6100 LCD 3D projections demo using Microchip's PIC18F25J11. PIC18F25J11 is clocked at 12MHz external oscillator with 4xPLL enabled. It's operated at 3.3V supply, same with the LCD (and so, direct connections and higher spi clock rates are possible).

The demo is all about simple 3D projection - no rendering, no raycasting, etc., just the plotting of edges/lines. It displays common polyhedrons like tetrahedron, hexahedron(cube), octahedron, square pyramid, and triangular prism.

"3Ddemo.c"

*based on original sources:
Nokia 6100 LCD with CCS C
3D Vector objects in C using the PIC micro

Microchip C18 project:  n6610lcd_3D_demo.zip