//*** GLOBAL VARIABLES *** // Written by Jarek Rossignac, June 2006 // CAMERA pt Origin=new pt(0,0,0); pt Eye=new pt(0,0,800); cam C = new cam(Eye, Origin); cam C1 = new cam(Eye, Origin); cam C2 = new cam(Eye, Origin); float svd=800; //float fov=atan2(width/2,svd); float fov=PI/3; pt Cbox = new pt(width/2,height/2,0); // mini-max box center float Rbox=1000; // CAMERA pt Mouse = new pt(0,0,0); // current mouse position float xr, yr = 0; // mouse coordinates relative to center of window int px=0, py=0; // coordinats of mouse when it was last pressed // DISPLAY vec labelD=new vec(-10,-10, 2); // offset vector for drawing labels boolean showNormals=false, showVertices=false, showEdges=true, showLabels=false, showPath=false; // flags for rendering boolean jumps=true; color grey = color(200, 200, 210), red = color(200, 10, 10), blue = color(10, 10, 200), lightblue = color(100, 100, 255), green = color(10, 200, 20), black = color(10, 10, 10), magenta = color(250, 150, 200), brown = color(150, 100, 50), yellow = color(255, 238, 70); // FILES String [] fn= new String[4]; int fni=0; // VERTICES int w=4; // size of initial Tmesh-grid made in setup int nv = w*w, maxnv = 10000;; // current and max number of vertices pt[] G = new pt [maxnv]; // geometry table (vertices) vec[] Nv = new vec [maxnv]; // vertex normals or laplace vectors int [] valence = new int [maxnv]; // vertex valence (count of incident triangles) int[] Mv = new int[maxnv]; // vertex markers // TRIANGLES int nt = 2*(w-1)*(w-1), maxnt = maxnv*2; // current and max number of triangles vec[] Nt = new vec [maxnt]; // vtriangles normals int[] Mt = new int[maxnt]; // triangle markers for distance and other things int[] SMt = new int[maxnt]; // sum of triangle markers for isolation boolean flipOrientation=false; // if set, save will flip all triangles int rings=1; // number of rings for colorcoding // CORNERS int nc = nt*3; // current number of corners (3 per triangle) int[] V = new int [3*maxnt]; // V table (triangle/vertex indices) int[] O = new int [3*maxnt]; // O table (opposite corner indices) int[] W = new int [3*maxnt]; // mid-edge vertex indices for subdivision (associated with corner opposite to edge) int c = 0; // current corner shown in image and manipulated with keys: n, p, o, l, r boolean[] P = new boolean [3*maxnt];