Class PointSet3D

java.lang.Object
edu.cnu.mdi.mdi3D.item3D.Item3D
edu.cnu.mdi.mdi3D.item3D.PointSet3D

public class PointSet3D extends Item3D
A set of same-color, same-size points, drawn as either square or circular point sprites.
  • Constructor Details

    • PointSet3D

      public PointSet3D(Panel3D panel3D, float[] coords, Color color, float pointSize, boolean circular)
      Create a set of same color and size points for use on a Panel3D.
      Parameters:
      panel3D - the owner 3D panel
      coords - the points as [x1, y1, z1, ..., xn, yn, zn]
      color - the color of the points
      pointSize - the drawing size of the points
      circular - if true, draw round point sprites; if false, square
  • Method Details

    • draw

      public void draw(com.jogamp.opengl.GLAutoDrawable drawable)
      Description copied from class: Item3D
      The custom drawing method
      Specified by:
      draw in class Item3D
      Parameters:
      drawable - the OpenGL drawable
    • setCoords

      public void setCoords(float[] coords)
      Set the coordinates of the points.
      Parameters:
      coords - the points as [x1, y1, z1, ..., xn, yn, zn]
    • getCentroid

      public float[] getCentroid()
      Compute the centroid (mean position) of the points.
      Returns:
      the centroid as [x, y, z]
    • getSortPoint

      public float[] getSortPoint()
      Description copied from class: Item3D
      A representative point for transparent sorting, in world coordinates. Default is origin. Override in items with a natural center (Sphere, Cube, Cylinder, etc.).
      Overrides:
      getSortPoint in class Item3D
      Returns:
      the sort point as [x, y, z]