org.jzy3d.io.obj
Class OBJFile
- java.lang.Object
-
- org.jzy3d.io.obj.OBJFile
-
public class OBJFile extends java.lang.ObjectTranslated from C++ Version: nvModel.h - Model support class The nvModel class implements an interface for a multipurpose model object. This class is useful for loading and formatting meshes for use by OpenGL. It can compute face normals, tangents, and adjacency information. The class supports the obj file format. Author: Evan Hart Email: sdkfeedback@nvidia.com Copyright (c) NVIDIA Corporation. All rights reserved.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classOBJFile.IdxSetstatic classOBJFile.PrimTypeEnumeration of primitive types
-
Field Summary
Fields Modifier and Type Field and Description static intNumPrimTypes
-
Constructor Summary
Constructors Constructor and Description OBJFile()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclearNormals()voidcompileModel()This function takes the raw model data in the internal structures, and attempts to bring it to a format directly accepted for vertex array style rendering.BoundingBox3dcomputeBoundingBox()Returns the points defining the axis-aligned bounding box containing the model.java.nio.IntBuffergetCompiledIndices()intgetCompiledNormalOffset()intgetCompiledPositionOffset()intgetCompiledVertexCount()intgetCompiledVertexSize()java.nio.FloatBuffergetCompiledVertices()intgetIndexCount()intgetNormalCount()java.util.List<java.lang.Integer>getNormalIndices()java.util.List<java.lang.Float>getNormals()intgetNormalSize()intgetOpenEdgeCount()intgetPositionCount()java.util.List<java.lang.Integer>getPositionIndices()java.util.List<java.lang.Float>getPositions()intgetPositionSize()booleanhasNormals()booleanloadModelFromFilename(java.lang.String file)booleanloadModelFromURL(java.net.URL fileURL)This function attempts to determine the type of the filename passed as a parameter.
-
-
-
Field Detail
-
NumPrimTypes
public static final int NumPrimTypes
- See Also:
- Constant Field Values
-
-
Method Detail
-
loadModelFromFilename
public boolean loadModelFromFilename(java.lang.String file)
-
loadModelFromURL
public boolean loadModelFromURL(java.net.URL fileURL)
This function attempts to determine the type of the filename passed as a parameter. If it understands that file type, it attempts to parse and load the file into its raw data structures. If the file type is recognized and successfully parsed, the function returns true, otherwise it returns false.
-
compileModel
public void compileModel()
This function takes the raw model data in the internal structures, and attempts to bring it to a format directly accepted for vertex array style rendering. This means that a unique compiled vertex will exist for each unique combination of position, normal, tex coords, etc that are used in the model. The prim parameter, tells the model what type of index list to compile. By default it compiles a simple triangle mesh with no connectivity.
-
computeBoundingBox
public BoundingBox3d computeBoundingBox()
Returns the points defining the axis-aligned bounding box containing the model.
-
clearNormals
public void clearNormals()
-
hasNormals
public boolean hasNormals()
-
getPositionSize
public int getPositionSize()
-
getNormalSize
public int getNormalSize()
-
getPositions
public java.util.List<java.lang.Float> getPositions()
-
getNormals
public java.util.List<java.lang.Float> getNormals()
-
getPositionIndices
public java.util.List<java.lang.Integer> getPositionIndices()
-
getNormalIndices
public java.util.List<java.lang.Integer> getNormalIndices()
-
getPositionCount
public int getPositionCount()
-
getNormalCount
public int getNormalCount()
-
getIndexCount
public int getIndexCount()
-
getCompiledVertices
public java.nio.FloatBuffer getCompiledVertices()
-
getCompiledIndices
public java.nio.IntBuffer getCompiledIndices()
-
getCompiledPositionOffset
public int getCompiledPositionOffset()
-
getCompiledNormalOffset
public int getCompiledNormalOffset()
-
getCompiledVertexSize
public int getCompiledVertexSize()
-
getCompiledVertexCount
public int getCompiledVertexCount()
-
getOpenEdgeCount
public int getOpenEdgeCount()
-
-
DMelt 3.0 © DataMelt by jWork.ORG