public void Setup() { objWorker = new ObjWorker { IoWorker = new IoWorker(), ObjLoaderFactory = new ObjLoaderFactory(), ModelToObjectConverter = new ModelToMeshConverter() }; }
private Mesh GetMesh(SceneFormat.SceneObject parsedObject) { switch (parsedObject.MeshCase) { case SceneFormat.SceneObject.MeshOneofCase.Sphere: return(new Sphere((float)parsedObject.Sphere.Radius)); case SceneFormat.SceneObject.MeshOneofCase.Cube: return(new Box(ConvertVector(parsedObject.Cube.Size) * 0.5f)); case SceneFormat.SceneObject.MeshOneofCase.Plane: return(new Plane()); case SceneFormat.SceneObject.MeshOneofCase.Disk: return(new Disk((float)parsedObject.Disk.Radius)); case SceneFormat.SceneObject.MeshOneofCase.MeshedObject: return(ObjWorker.Parse(parsedObject.MeshedObject.Reference)); default: throw new Exception("Unsupported mesh"); } }
public virtual void LoadFromObj(string filename) { ObjWorker.GetInstance().LoadObj(filename, out Vertices, out UVs, out Normals, out VertexIndices); }