public class ColladaModel extends java.lang.Object implements DataAssembler.LoadingListener, java.io.Serializable
This class holds all 3D data and supports transform functions
This source is free; you can redistribute it and/or modify it under the terms of the GNU General Public License and by nameing of the originally author
| Modifier and Type | Field and Description |
|---|---|
private PApplet |
applet |
private java.util.ArrayList<Line> |
lines |
private java.util.ArrayList<Triangle> |
triangles |
| Constructor and Description |
|---|
ColladaModel(PApplet applet) |
| Modifier and Type | Method and Description |
|---|---|
void |
draw()
Draws the model using Processing P3D renderer.
|
void |
draw2D()
Draws collada using Processing default 2D renderer
|
java.util.ArrayList<Line> |
getLines()
returns all parsed lines or grid structures from dae file
|
java.util.ArrayList<Triangle> |
getTriangles()
returns all parsed triangles from dae file
|
void |
linesParsed(java.util.ArrayList<Line> lines)
callback fired by any Class in asmbeans package
|
void |
rotate(float radiant,
char axis)
Rotates the model (not the view) in X,Y,or Z Axis
|
void |
scale(float factor)
makes the model (not the view) smaller or bigger
|
void |
shift(float len,
char axis)
shifts the model (not the view) along the axis x,y or z
|
void |
trianglesParsed(java.util.ArrayList<Triangle> triangles)
callback fired by any Class in asmbeans package
|
private java.util.ArrayList<Triangle> triangles
private java.util.ArrayList<Line> lines
private PApplet applet
public ColladaModel(PApplet applet)
current - Processing sketchpublic java.util.ArrayList<Triangle> getTriangles()
public java.util.ArrayList<Line> getLines()
public void trianglesParsed(java.util.ArrayList<Triangle> triangles)
trianglesParsed in interface DataAssembler.LoadingListenerpublic void linesParsed(java.util.ArrayList<Line> lines)
linesParsed in interface DataAssembler.LoadingListenerpublic void draw()
Draws the model using Processing P3D renderer.
The source code of this method can be used as drawing example if user want to customize
.This is a untested part because software developers platform crashed on actual P3D/P2D version so he was forced to use the GLAdapter instead
public void draw2D()
public void scale(float factor)
factor - value < 1.0f = smaller, value > 1.0f = biggerpublic void shift(float len,
char axis)
len - (in pixels)axis - valid characters for the axis is: 'x','y' or 'z'public void rotate(float radiant,
char axis)
radiant - from 0 to 2*PIaxis - valid characters for the axis is: 'x','y' or 'z'