protected Vector3 ToVector3S(Point3 p) { if (ChangeCoordinateSystem) { return new Vector3() { x = p.x, y = p.z, z = p.y }; } else { return new Vector3() { x = p.x, y = p.y, z = p.z }; } }
protected Vector2 ToVector2(Point3 p) { return new Vector3() { x = p.x, y = p.y }; }
protected VertexComponents BuildVertexComponents(FaceTriplets triplets, Point3[] positions, Point3[] normals, Point3[] tex1, Point3[] tex2 ) { int vertexcount = triplets.uniqueTriplets.Count; var vc = new VertexComponents(vertexcount); for (int i = 0; i < vertexcount; i++) { Triplet triplet = triplets.uniqueTriplets[i]; vc.vertices[i] = ToVector3(positions[triplet.v]); vc.normals[i] = ToVector3(normals[triplet.n]); vc.uvs[i] = ToVector2(tex1[triplet.t]); vc.uvs2[i] = ToVector2(tex2[triplet.y]); } return vc; }