Class BezierPatch

java.lang.Object
toxi.geom.mesh.BezierPatch

public class BezierPatch extends Object
4x4 bezier patch implementation with tesselation support (dynamic resolution) for generating triangle mesh representations.
  • Field Details

    • points

      public Vec3D[][] points
  • Constructor Details

    • BezierPatch

      public BezierPatch()
    • BezierPatch

      public BezierPatch(Vec3D[][] points)
  • Method Details

    • computePointAt

      public static Vec3D computePointAt(float u, float v, Vec3D[][] points)
      Computes a single point on the bezier surface given by the 2d array of control points. The desired point's coordinates have to be specified in UV space (range 0.0 .. 1.0). The implementation does not check or enforce the correct range of these coords and will not return valid points if the range is exceeded.
      Parameters:
      u - positive normalized U coordinate on the bezier surface
      v - positive normalized V coordinate on the bezier surface
      points - 4x4 array defining the patch's control points
      Returns:
      point on surface
    • computePointAt

      public Vec3D computePointAt(float u, float v)
    • set

      public BezierPatch set(int x, int y, Vec3D p)
    • toMesh

      public Mesh3D toMesh(int res)
    • toMesh

      public Mesh3D toMesh(Mesh3D mesh, int res)