Class SpatialLoader
java.lang.Object
com.eco.bio7.spatial.SpatialLoader
This is a utility class for Jogl (OpenGL) to load and create models and
textures.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.jogamp.opengl.util.texture.TexturecreateTexture(String path, com.jogamp.opengl.GL2 gl) This method creates a texture from a given path.static StringgetFileName(String path) This method returns the filename of a given file without the extension.static com.eco.bio7.loader3d.MeshModelLoads a mesh file (OBJ with materials, STL, PLY or OFF) as a model.static OBJModelThis method loads an object model from the given path.static OBJModelThis method loads an object model from the given path.protected void
-
Field Details
-
objectName
-
objectPath
-
-
Constructor Details
-
SpatialLoader
public SpatialLoader(com.jogamp.opengl.GL2 gl_)
-
-
Method Details
-
loadModel
-
loadModel
-
loadObjModel
protected void loadObjModel() -
loadMesh
Loads a mesh file (OBJ with materials, STL, PLY or OFF) as a model.- Parameters:
path- the path of the filesize- the size of the largest dimension in the 3D view- Returns:
- the model or null if the file can't be loaded
-
createTexture
public static com.jogamp.opengl.util.texture.Texture createTexture(String path, com.jogamp.opengl.GL2 gl) This method creates a texture from a given path.- Parameters:
path- the path to the texture.gl- an OpenGL context.- Returns:
- t a Texture object.
-
getFileName
-