Home
Categories
Coilguns
AVR Projects
Gumstix Projects
PIC Projects
Tutorials
The Forum
Contact Me

If you like this
site please

page counter

OLED 3-D Triangle

6/18/08
void get_lines(uint8_t poly_num)
{
This line starts the function. The variable poly_num tells it which polygon (in Poly_2D) to find the horizontal lines for.

float slopetb,yinttb,slopes1,yints1;
signed char topt=0,bott=0,side=0,ypt;
These lines initialize the variables used. "slopetb" is used to store the slope of the longest side, slope top bottom. "yinttb" is the y-intercept for the longest side. "slopes1" stores the slope of the shorter sides when they are needed. "yints1" stores the y-intercept for the shorter sides when they are needed. "topt", "bott", and "side" store the points location. For example if topt=0 then the first point in Poly_2D is the highest point. "ypt" stands for "y point" and it is used to count from the top point to the lowest point down the Y axis.