primitive(s)
//Makes a 3D coordinate
//===================================================================
function Point(x,y,z) {
this.x = x;
this.y = y;
this.z = z; //if omit z value, just make point 2D
return this;
}
//Makes a 3D vector A(x,y,z) -> B(x,y,z)
//===================================================================
function Vector(a,b,c) {
this.a = a; //Point
this.b = b;
this.c = c;
return this;
}
//The points are projected onto the plane defined by the viewport vector
var viewport = new Vector(new Point(-100,-190,-100),new Point(100,10,-100), new Point(50,50));
//The camera's position is used for calculating focal length and where
//the points should be plotted on the viewport
var camera = new Point(0,-90,-200);