Class MeshRenderer

java.lang.Object
MeshRenderer

public class MeshRenderer extends Object
Class for rendering a surface triangle mesh (using Processing)
Author:
Luca Castelli Aleardi (INF555, 2012)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Jcg.polyhedron.Polyhedron_3<Jcg.geometry.Point_3>
     
    (package private) double
     
    (package private) processing.core.PApplet
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    MeshRenderer(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 Type
    Method
    Description
    double
    Compute the scale factor (depending on the max distance of the point set)
    void
    draw(int type)
    Draw the entire mesh
    void
    Draw the X, Y and Z axis
    void
    drawFace(Jcg.polyhedron.Face<Jcg.geometry.Point_3> f)
    Draw a (triangle or polygonal) face
    void
    drawSegment(Jcg.geometry.Point_3 p, Jcg.geometry.Point_3 q)
    Draw a segment between two points
    void
    drawTriangle(Jcg.geometry.Point_3 p, Jcg.geometry.Point_3 q, Jcg.geometry.Point_3 r)
    Draw a triangle
    void
    drawVertex(Jcg.geometry.Point_3 p)
    Draw a vertex (as a small sphere)
    static double
    round(double x, int precision)
    Return the value after truncation
    void
    Update the scale factor

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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