Class MeshRenderer
java.lang.Object
MeshRenderer
Class for rendering a surface triangle mesh (using Processing)
- Author:
- Luca Castelli Aleardi (INF555, 2012)
-
Field Summary
FieldsModifier and TypeFieldDescriptionJcg.polyhedron.Polyhedron_3<Jcg.geometry.Point_3> (package private) double(package private) processing.core.PApplet -
Constructor Summary
ConstructorsConstructorDescriptionMeshRenderer(processing.core.PApplet view, Jcg.polyhedron.Polyhedron_3<Jcg.geometry.Point_3> polyhedron3D) Create a surface mesh from an OFF file -
Method Summary
Modifier and TypeMethodDescriptiondoubleCompute the scale factor (depending on the max distance of the point set)voiddraw(int type) Draw the entire meshvoiddrawAxis()Draw the X, Y and Z axisvoiddrawFace(Jcg.polyhedron.Face<Jcg.geometry.Point_3> f) Draw a (triangle or polygonal) facevoiddrawSegment(Jcg.geometry.Point_3 p, Jcg.geometry.Point_3 q) Draw a segment between two pointsvoiddrawTriangle(Jcg.geometry.Point_3 p, Jcg.geometry.Point_3 q, Jcg.geometry.Point_3 r) Draw a trianglevoiddrawVertex(Jcg.geometry.Point_3 p) Draw a vertex (as a small sphere)static doubleround(double x, int precision) Return the value after truncationvoidUpdate the scale factor
-
Field Details
-
scaleFactor
double scaleFactor -
view
processing.core.PApplet view -
polyhedron3D
public Jcg.polyhedron.Polyhedron_3<Jcg.geometry.Point_3> polyhedron3D
-
-
Constructor Details
-
MeshRenderer
public MeshRenderer(processing.core.PApplet view, Jcg.polyhedron.Polyhedron_3<Jcg.geometry.Point_3> polyhedron3D) Create a surface mesh from an OFF file
-
-
Method Details
-
drawSegment
public void drawSegment(Jcg.geometry.Point_3 p, Jcg.geometry.Point_3 q) Draw a segment between two points -
drawVertex
public void drawVertex(Jcg.geometry.Point_3 p) Draw a vertex (as a small sphere) -
drawTriangle
public void drawTriangle(Jcg.geometry.Point_3 p, Jcg.geometry.Point_3 q, Jcg.geometry.Point_3 r) Draw a triangle -
drawFace
public void drawFace(Jcg.polyhedron.Face<Jcg.geometry.Point_3> f) Draw a (triangle or polygonal) face -
draw
public void draw(int type) Draw the entire mesh -
drawAxis
public void drawAxis()Draw the X, Y and Z axis -
round
public static double round(double x, int precision) Return the value after truncation -
computeScaleFactor
public double computeScaleFactor()Compute the scale factor (depending on the max distance of the point set) -
updateScaleFactor
public void updateScaleFactor()Update the scale factor
-