Module imp3d

Class Supershape

All Implemented Interfaces:
Transformation, Pickable, Renderable, Manageable, PersistenceCapable, Shareable, UserFields, XObject, Map, Serializable

public class Supershape extends ShadedNull implements Pickable, Renderable
This class represents a supershape. An implementation of Johan Gielis's Superformula which was published in the American Journal of Botany 90(3): 333–338. 2003. INVITED SPECIAL PAPER A GENERIC GEOMETRIC TRANSFORMATION THAT UNIFIES A WIDE RANGE OF NATURAL AND ABSTRACT SHAPES
Author:
MH
See Also:
  • Field Details

  • Constructor Details

    • Supershape

      public Supershape()
    • Supershape

      public Supershape(float a, float b, float m, float n1, float n2, float n3)
    • Supershape

      public Supershape(float a, float b, float m1, float n11, float n12, float n13, float m2, float n21, float n22, float n23)
  • Method Details

    • pick

      public void pick(Object object, boolean asNode, Point3d origin, Vector3d direction, Matrix4d transformation, PickList list)
      Description copied from interface: Pickable
      Computes intersections of a given ray with this shape.
      Specified by:
      pick in interface Pickable
      Parameters:
      object - the object of which this shape is an attribute
      asNode - true iff object is a node
      origin - the origin of the ray, in local coordinates
      direction - the direction of the ray, in local coordinates
      transformation - the transformation from local coordinates to world coordinates
      list - the list to which intersections have to be added
    • draw

      public void draw(Object object, boolean asNode, RenderState rs)
      Specified by:
      draw in interface Renderable
    • getNTypeImpl

      protected Node.NType getNTypeImpl()
      Description copied from class: Node
      This method returns the Node.NType which describes the managed fields of the class of this node. This method has to be implemented in every concrete subclass.
      Overrides:
      getNTypeImpl in class ShadedNull
      Returns:
      type describing the managed fields of the class of this node
    • newInstance

      protected Node newInstance()
      Description copied from class: Node
      This method returns a new instance of the class of this node. This method has to be implemented in every concrete subclass.
      Overrides:
      newInstance in class ShadedNull
      Returns:
      new instance of class of this node
    • getA

      public float getA()
    • getB

      public float getB()
    • getM1

      public float getM1()
    • getN11

      public float getN11()
    • getN12

      public float getN12()
    • getN13

      public float getN13()
    • getM2

      public float getM2()
    • getN21

      public float getN21()
    • getN22

      public float getN22()
    • getN23

      public float getN23()
    • setA

      public void setA(float value)
    • setB

      public void setB(float value)
    • setM1

      public void setM1(float value)
    • setN11

      public void setN11(float value)
    • setN12

      public void setN12(float value)
    • setN13

      public void setN13(float value)
    • setM2

      public void setM2(float value)
    • setN21

      public void setN21(float value)
    • setN22

      public void setN22(float value)
    • setN23

      public void setN23(float value)