Class DrawPolyhedronProcessing
java.lang.Object
Jcg.viewer.DrawSkeleton
Jcg.viewer.DrawMesh
Jcg.viewer.processing3d.DrawPolyhedronProcessing
Class for drawing a surface mesh (Polyhedron_3) in 3D, using a Processing PApplet
- Author:
- Luca Castelli Aleardi (INF562/555, 2012-20)
-
Field Summary
FieldsModifier and TypeFieldDescriptionColor[]a basic set of predefined colors for drawing faces, edges and verticesfloat[][]the triangle mesh (to be rendered)the triangle soup (to be rendered)float[][](package private) processing.core.PAppletProcessing (P3D) frame for rendering 3D objects (meshes, faces, edges, points, ...)Fields inherited from class Jcg.viewer.DrawSkeleton
NO_VERTICES_NO_EDGES, ONLY_EDGES, VERTICES_AND_EDGES -
Constructor Summary
ConstructorsConstructorDescriptionDrawPolyhedronProcessing(MeshViewerProcessing view, Collection<Triangle_3> triangles) Create a 3D triangle soupDrawPolyhedronProcessing(MeshViewerProcessing view, Polyhedron_3<Point_3> polyhedron3D, float[][] edgeColors) Create a surface mesh from a 3D polyhedron (3D surface mesh).DrawPolyhedronProcessing(processing.core.PApplet view, String filename) Create a surface mesh from an OFF fileDrawPolyhedronProcessing(processing.core.PApplet view, Polyhedron_3<Point_3> polyhedron3D) Create a surface mesh -
Method Summary
Modifier and TypeMethodDescriptionfloatCompute the scale factor (depending on the max distance of the point set)voidDefine a basic set of 13 colors for drawing edges, faces, vertices.voiddraw(int type) Draw the 3D scenevoidDraw a (triangle or polygonal) facevoidDraw a (triangle or polygonal) facevoidDraw a (triangle or polygonal) face of a Polyhedral surfacevoiddrawMesh(int type) Draw the entire meshvoiddrawNormal(Point_3 p, float[] normal) Draw the vertex normalvoiddrawSegment(Point_3 p, Point_3 q) Draw a segment between two pointsvoiddrawSegment(Point_3 p, Point_3 q, float[] color) Draw a segment between two pointsvoiddrawTriangle(Point_3 p, Point_3 q, Point_3 r) Draw a trianglevoiddrawTriangleSoup(int type) Draw the triangle soupvoidDraw a vertex (as a small sphere)static voidresetMeshColors(Polyhedron_3 mesh) Reset face/edge/vertex colors.Methods inherited from class Jcg.viewer.DrawSkeleton
computeBoundingBox, drawAxis, drawBoundingBox, round
-
Field Details
-
view
processing.core.PApplet viewProcessing (P3D) frame for rendering 3D objects (meshes, faces, edges, points, ...) -
polyhedron3D
the triangle mesh (to be rendered) -
triangleSoup
the triangle soup (to be rendered) -
edgeColors
public float[][] edgeColors -
vertexNormals
public float[][] vertexNormals -
colors
a basic set of predefined colors for drawing faces, edges and vertices
-
-
Constructor Details
-
DrawPolyhedronProcessing
Create a surface mesh -
DrawPolyhedronProcessing
Create a surface mesh from an OFF file -
DrawPolyhedronProcessing
public DrawPolyhedronProcessing(MeshViewerProcessing view, Polyhedron_3<Point_3> polyhedron3D, float[][] edgeColors) Create a surface mesh from a 3D polyhedron (3D surface mesh). Edges are endowed with colors (RGB format) -
DrawPolyhedronProcessing
Create a 3D triangle soup
-
-
Method Details
-
createColors
public void createColors()Define a basic set of 13 colors for drawing edges, faces, vertices. -
drawSegment
Draw a segment between two points- Specified by:
drawSegmentin classDrawSkeleton
-
drawNormal
Draw the vertex normal -
drawSegment
-
drawVertex
Draw a vertex (as a small sphere)- Specified by:
drawVertexin classDrawSkeleton
-
drawTriangle
Draw a triangle- Specified by:
drawTrianglein classDrawMesh
-
drawFace
-
drawFace
-
drawFace
-
drawMesh
public void drawMesh(int type) Draw the entire mesh -
drawTriangleSoup
public void drawTriangleSoup(int type) Draw the triangle soup -
draw
public void draw(int type) Draw the 3D scene- Specified by:
drawin classDrawSkeleton- Parameters:
type- indicates the rendering mode
-
computeScaleFactor
public float computeScaleFactor()Compute the scale factor (depending on the max distance of the point set) -
resetMeshColors
Reset face/edge/vertex colors.
Set the initial tag of all faces, edges and vertices to a given value (used for color rendering)
-