/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package colorsegmentation;

import baseclasses.ObjImport;
import baseclasses.ObjExport;
import baseclasses.Point;
import java.io.IOException;

/**
 *
 * @author Alex
 */
public class ColorShift {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        ObjImport scanImport = new ObjImport("ICP_Face.obj");
        try {
            scanImport.read();
        } catch (IOException e) {
            System.out.println("wat.");
        }
        Point[] pts = scanImport.getPoints();
        
        for (int goodPtInd = 0; goodPtInd < pts.length; goodPtInd++) {
            Point temp = pts[goodPtInd];
            double[] tempCoor = temp.getCoor();
            Point nTemp = new Point(tempCoor[0], tempCoor[1], 
                    tempCoor[2], 1.0, 0.0, 0.0);
            pts[goodPtInd] = nTemp;
        }
            
        System.out.println("\nExporting");
        System.out.println("=======================");
        ObjExport ex = new ObjExport("ICP_FaceRed.obj", 
                pts, scanImport.getTriangles());
        try {
            ex.write();
        } catch (IOException e) {
            System.out.println("Error on Export");
        }
    }
    
}
