| Modifier and Type | Method and Description |
|---|---|
static Obj |
convertToRenderable(ReadableObj input)
Convert the given
ReadableObj into an Obj that has
a structure appropriate for rendering it with OpenGL:
Triangulate it
Make the texture coordinates unique
Make the normals unique
Make the result vertex-indexed
|
static <T extends WritableObj> |
convertToRenderable(ReadableObj input,
T output)
Convert the given
ReadableObj into an Obj that has
a structure appropriate for rendering it with OpenGL:
Triangulate it
Make the texture coordinates unique
Make the normals unique
Make the result vertex-indexed
|
static String |
createInfoString(ReadableObj obj)
Create a multi-line, formatted string containing information about
the given
ReadableObj. |
static Obj |
groupToObj(ReadableObj input,
ObjGroup inputGroup,
List<Integer> vertexIndexMapping)
Returns the given group of the given
ReadableObj as a new
Obj. |
static <T extends WritableObj> |
groupToObj(ReadableObj input,
ObjGroup inputGroup,
List<Integer> vertexIndexMapping,
T output)
Stores the given group of the given
ReadableObj
in the given output WritableObj. |
static Obj |
makeNormalsUnique(ReadableObj input)
Ensures that two vertices with different normals are
actually two different vertices with different indices.
|
static <T extends WritableObj> |
makeNormalsUnique(ReadableObj input,
List<Integer> indexMapping,
T output)
Ensures that two vertices with different normals are
actually two different vertices with different indices.
|
static Obj |
makeTexCoordsUnique(ReadableObj input)
Ensures that two vertices with different texture coordinates are
actually two different vertices with different indices.
|
static <T extends WritableObj> |
makeTexCoordsUnique(ReadableObj input,
List<Integer> indexMapping,
T output)
Ensures that two vertices with different texture coordinates are
actually two different vertices with different indices.
|
static Obj |
makeVertexIndexed(ReadableObj input)
Converts the given
ReadableObj data into data that uses the
same indices for vertices, texture coordinates and normals, and
returns the result. |
static <T extends WritableObj> |
makeVertexIndexed(ReadableObj input,
T output)
Converts the given
ReadableObj data into data that uses the
same indices for vertices, texture coordinates and normals, and
stores the result in the given WritableObj. |
static Obj |
triangulate(ReadableObj input)
Triangulates the given input
ReadableObj and returns the
result. |
static <T extends WritableObj> |
triangulate(ReadableObj input,
T output)
Triangulates the given input
ReadableObj and stores the result
in the given WritableObj. |
public static Obj convertToRenderable(ReadableObj input)
ReadableObj into an Obj that has
a structure appropriate for rendering it with OpenGL:
Triangulate itMake the texture coordinates unique
Make the normals unique
vertex-indexed
input - The input ReadableObjObjpublic static <T extends WritableObj> T convertToRenderable(ReadableObj input, T output)
ReadableObj into an Obj that has
a structure appropriate for rendering it with OpenGL:
Triangulate itMake the texture coordinates unique
Make the normals unique
vertex-indexed
T - The type of the outputinput - The input ReadableObjoutput - The output WritableObjpublic static Obj triangulate(ReadableObj input)
ReadableObj and returns the
result.input - The input ReadableObjObjpublic static <T extends WritableObj> T triangulate(ReadableObj input, T output)
ReadableObj and stores the result
in the given WritableObj.T - The type of the outputinput - The input ReadableObjoutput - The output WritableObjpublic static Obj groupToObj(ReadableObj input, ObjGroup inputGroup, List<Integer> vertexIndexMapping)
ReadableObj as a new
Obj.vertexIndexMapping may be null. If it
is not null, vertexIndexMapping.get(i)
afterwards stores the index that vertex i had in the
input.input - The input ReadableObjinputGroup - The group of the inputvertexIndexMapping - The optional index mappingObjpublic static <T extends WritableObj> T groupToObj(ReadableObj input, ObjGroup inputGroup, List<Integer> vertexIndexMapping, T output)
ReadableObj
in the given output WritableObj.vertexIndexMapping may be null. If it
is not null, vertexIndexMapping.get(i)
afterwards stores the index that vertex i had in the
input.T - The type of the outputinput - The input ReadableObjinputGroup - The group of the inputvertexIndexMapping - The optional index mappingoutput - The output WritableObjpublic static Obj makeTexCoordsUnique(ReadableObj input)
input - The input ReadableObjObjpublic static <T extends WritableObj> T makeTexCoordsUnique(ReadableObj input, List<Integer> indexMapping, T output)
null. Otherwise it is assumed that
it already contains the index mapping that was obtained by a call
to groupToObj(ReadableObj, ObjGroup, List, WritableObj), and
this mapping will be updated appropriately.T - The type of the outputinput - The input ReadableObjindexMapping - The optional index mappingoutput - The output WritableObjpublic static Obj makeNormalsUnique(ReadableObj input)
input - The input ReadableObjObjpublic static <T extends WritableObj> T makeNormalsUnique(ReadableObj input, List<Integer> indexMapping, T output)
null. Otherwise it is assumed that
it already contains the index mapping that was obtained by a call
to groupToObj(ReadableObj, ObjGroup, List, WritableObj), and
this mapping will be updated appropriately.T - The type of the outputinput - The input ReadableObjindexMapping - The optional index mappingoutput - The output WritableObjpublic static Obj makeVertexIndexed(ReadableObj input)
ReadableObj data into data that uses the
same indices for vertices, texture coordinates and normals, and
returns the result.makeTexCoordsUnique(ReadableObj) and
makeNormalsUnique(ReadableObj), respectively.input - The input ReadableObjObjpublic static <T extends WritableObj> T makeVertexIndexed(ReadableObj input, T output)
ReadableObj data into data that uses the
same indices for vertices, texture coordinates and normals, and
stores the result in the given WritableObj.makeTexCoordsUnique(ReadableObj) and
makeNormalsUnique(ReadableObj), respectively.T - The type of the outputinput - The input ReadableObjoutput - The output WritableObjpublic static String createInfoString(ReadableObj obj)
ReadableObj. This method is solely intended for
debugging. It should not be considered as part of the public API.
The exact output is not specified.obj - The ReadableObjCopyright © 2015. All rights reserved.