Class OBJModel
java.lang.Object
com.eco.bio7.loader3d.MeshModel
com.eco.bio7.loader3d.OBJModel
public class OBJModel
extends com.eco.bio7.loader3d.MeshModel
A model of an OBJ file (with the materials and textures of the MTL file),
centered and scaled to a size. The file is read with the MeshReader (also
polygons, negative indices and vertex colors), see MeshModel for the other
formats.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionArrayList<com.eco.bio7.loader3d.Tuple3> Returns the normals of the vertices (empty if the file has no normals).ArrayList<com.eco.bio7.loader3d.Tuple3> Returns the texture coordinates of the vertices (empty if the file has none).ArrayList<com.eco.bio7.loader3d.Tuple3> getVerts()Returns the vertices of the file (centered and scaled like the display).Methods inherited from class com.eco.bio7.loader3d.MeshModel
draw, getDisplayPositions, getFormat, getMaxSize, getMeshData, getModelDims, getName, getNumFaces, getNumVertices, getReport, getWeldedMesh, load
-
Constructor Details
-
OBJModel
Loads the OBJ file path + nm + ".obj".- Parameters:
nm- the name of the file without the extensionpath- the directory (with a separator at the end)sz- the size of the largest dimension in the 3D viewgl- the OpenGL context (not used, the model is drawn with draw)showDetails- prints the checks of the mesh- Throws:
UncheckedIOException- if the file can't be read
-
OBJModel
public OBJModel(com.eco.bio7.loader3d.MeshData mesh, float size) Creates the model of a read OBJ file (see MeshReader).- Parameters:
mesh- the meshsize- the size of the largest dimension in the 3D view
-
-
Method Details
-
getVerts
Returns the vertices of the file (centered and scaled like the display). -
getNormals
Returns the normals of the vertices (empty if the file has no normals). -
getTexCoords
Returns the texture coordinates of the vertices (empty if the file has none).
-