/* Computer Graphics, Assignment, Intersections
 * Filename ........ normals.c
 * Description ..... Calculates Plane/Vertex normals
 * Date ............ 19.08.2008
 */

#ifndef NORMALS_H
#define NORMALS_H

#include "polys.h"

typedef struct normals
{
	point **normal;
	int length;
	struct normals *prev;
}
normals;

void calcNormalsFlat(polys* list);
void calcNormalsGouraud(polys* list);

normals *createNormals(int size, normals *prev);
void addToNormals(point *p, normals *group);
int equalPoint(point p1, point p2);
point createPoint(GLdouble x, GLdouble y, GLdouble z);
point normalizeVector(point p);
point addVectors(point p1, point p2);
point substractVectors(point p1, point p2);
point scalarMultiply(point p, GLdouble scalar);
GLdouble dotProduct(point p1, point p2);
point crossProduct(point p1, point p2);

#endif
