Codota Logo
CurveAndSurfaceMath.prepareNurbsKnots
Code IndexAdd Codota to your IDE (free)

How to use
prepareNurbsKnots
method
in
com.jme3.math.CurveAndSurfaceMath

Best Java code snippets using com.jme3.math.CurveAndSurfaceMath.prepareNurbsKnots (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Constructor. Constructs required surface.
 * @param controlPoints space control points
 * @param nurbKnots knots of the surface
 * @param uSegments the amount of U segments
 * @param vSegments the amount of V segments
 * @param basisUFunctionDegree the degree of basis U function
 * @param basisVFunctionDegree the degree of basis V function
 * @param smooth defines if the mesu should be smooth (true) or flat (false)
 */
private Surface(List<List<Vector4f>> controlPoints, List<Float>[] nurbKnots, int uSegments, int vSegments, int basisUFunctionDegree, int basisVFunctionDegree, boolean smooth) {
  this.validateInputData(controlPoints, nurbKnots, uSegments, vSegments);
  type = SplineType.Nurb;
  this.uSegments = uSegments;
  this.vSegments = vSegments;
  this.controlPoints = controlPoints;
  knots = nurbKnots;
  this.basisUFunctionDegree = basisUFunctionDegree;
  CurveAndSurfaceMath.prepareNurbsKnots(nurbKnots[0], basisUFunctionDegree);
  if (nurbKnots[1] != null) {
    this.basisVFunctionDegree = basisVFunctionDegree;
    CurveAndSurfaceMath.prepareNurbsKnots(nurbKnots[1], basisVFunctionDegree);
  }
  this.buildSurface(smooth);
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Create a NURBS spline. A spline type is automatically set to SplineType.Nurb.
 * The cycle is set to <b>false</b> by default.
 * @param controlPoints a list of vector to use as control points of the spline
 * @param nurbKnots the nurb's spline knots
 */
public Spline(List<Vector4f> controlPoints, List<Float> nurbKnots) {
  //input data control
  for(int i=0;i<nurbKnots.size()-1;++i) {
    if(nurbKnots.get(i)>nurbKnots.get(i+1)) {
      throw new IllegalArgumentException("The knots values cannot decrease!");
    }
  }
  //storing the data
  type = SplineType.Nurb;
  this.weights = new float[controlPoints.size()];
  this.knots = nurbKnots;
  this.basisFunctionDegree = nurbKnots.size() - weights.length;
  for(int i=0;i<controlPoints.size();++i) {
    Vector4f controlPoint = controlPoints.get(i);
    this.controlPoints.add(new Vector3f(controlPoint.x, controlPoint.y, controlPoint.z));
    this.weights[i] = controlPoint.w;
  }
  CurveAndSurfaceMath.prepareNurbsKnots(knots, basisFunctionDegree);
  this.computeTotalLength();
}
origin: info.projectkyoto/mms-engine

/**
 * Constructor. Constructs required surface.
 * @param controlPoints space control points
 * @param nurbKnots knots of the surface
 * @param uSegments the amount of U segments
 * @param vSegments the amount of V segments
 * @param basisUFunctionDegree the degree of basis U function
 * @param basisVFunctionDegree the degree of basis V function
 */
private Surface(List<List<Vector4f>> controlPoints, List<Float>[] nurbKnots,
    int uSegments, int vSegments, int basisUFunctionDegree, int basisVFunctionDegree) {
  this.validateInputData(controlPoints, nurbKnots, uSegments, vSegments);
  this.type = SplineType.Nurb;
  this.uSegments = uSegments;
  this.vSegments = vSegments;
  this.controlPoints = controlPoints;
  this.knots = nurbKnots;
  this.basisUFunctionDegree = basisUFunctionDegree;
  CurveAndSurfaceMath.prepareNurbsKnots(nurbKnots[0], basisUFunctionDegree);
  if (nurbKnots[1] != null) {
    this.basisVFunctionDegree = basisVFunctionDegree;
    CurveAndSurfaceMath.prepareNurbsKnots(nurbKnots[1], basisVFunctionDegree);
  }
  this.buildSurface();
}
origin: org.jmonkeyengine/jme3-core

/**
 * Constructor. Constructs required surface.
 * @param controlPoints space control points
 * @param nurbKnots knots of the surface
 * @param uSegments the amount of U segments
 * @param vSegments the amount of V segments
 * @param basisUFunctionDegree the degree of basis U function
 * @param basisVFunctionDegree the degree of basis V function
 * @param smooth defines if the mesu should be smooth (true) or flat (false)
 */
private Surface(List<List<Vector4f>> controlPoints, List<Float>[] nurbKnots, int uSegments, int vSegments, int basisUFunctionDegree, int basisVFunctionDegree, boolean smooth) {
  this.validateInputData(controlPoints, nurbKnots, uSegments, vSegments);
  type = SplineType.Nurb;
  this.uSegments = uSegments;
  this.vSegments = vSegments;
  this.controlPoints = controlPoints;
  knots = nurbKnots;
  this.basisUFunctionDegree = basisUFunctionDegree;
  CurveAndSurfaceMath.prepareNurbsKnots(nurbKnots[0], basisUFunctionDegree);
  if (nurbKnots[1] != null) {
    this.basisVFunctionDegree = basisVFunctionDegree;
    CurveAndSurfaceMath.prepareNurbsKnots(nurbKnots[1], basisVFunctionDegree);
  }
  this.buildSurface(smooth);
}
origin: info.projectkyoto/mms-engine

/**
 * Create a NURBS spline. A spline type is automatically set to SplineType.Nurb.
 * The cycle is set to <b>false</b> by default.
 * @param controlPoints a list of vector to use as control points of the spline
 * @param nurbKnots the nurb's spline knots
 */
public Spline(List<Vector4f> controlPoints, List<Float> nurbKnots) {
  //input data control
  for(int i=0;i<nurbKnots.size()-1;++i) {
    if(nurbKnots.get(i)>nurbKnots.get(i+1)) {
      throw new IllegalArgumentException("The knots values cannot decrease!");
    }
  }
  //storing the data
  type = SplineType.Nurb;
  this.weights = new float[controlPoints.size()];
  this.knots = nurbKnots;
  this.basisFunctionDegree = nurbKnots.size() - weights.length;
  for(int i=0;i<controlPoints.size();++i) {
    Vector4f controlPoint = controlPoints.get(i);
    this.controlPoints.add(new Vector3f(controlPoint.x, controlPoint.y, controlPoint.z));
    this.weights[i] = controlPoint.w;
  }
  CurveAndSurfaceMath.prepareNurbsKnots(knots, basisFunctionDegree);
  this.computeTotalLentgh();
}
origin: org.jmonkeyengine/jme3-core

/**
 * Create a NURBS spline. A spline type is automatically set to SplineType.Nurb.
 * The cycle is set to <b>false</b> by default.
 * @param controlPoints a list of vector to use as control points of the spline
 * @param nurbKnots the nurb's spline knots
 */
public Spline(List<Vector4f> controlPoints, List<Float> nurbKnots) {
  //input data control
  for(int i=0;i<nurbKnots.size()-1;++i) {
    if(nurbKnots.get(i)>nurbKnots.get(i+1)) {
      throw new IllegalArgumentException("The knots values cannot decrease!");
    }
  }
  //storing the data
  type = SplineType.Nurb;
  this.weights = new float[controlPoints.size()];
  this.knots = nurbKnots;
  this.basisFunctionDegree = nurbKnots.size() - weights.length;
  for(int i=0;i<controlPoints.size();++i) {
    Vector4f controlPoint = controlPoints.get(i);
    this.controlPoints.add(new Vector3f(controlPoint.x, controlPoint.y, controlPoint.z));
    this.weights[i] = controlPoint.w;
  }
  CurveAndSurfaceMath.prepareNurbsKnots(knots, basisFunctionDegree);
  this.computeTotalLength();
}
com.jme3.mathCurveAndSurfaceMathprepareNurbsKnots

Javadoc

This method prepares the knots to be used. If the knots represent non-uniform B-splines (first and last knot values are being repeated) it leads to NaN results during calculations. This method adds a small number to each of such knots to avoid NaN's.

Popular methods of CurveAndSurfaceMath

  • computeBaseFunctionValue
    This method computes the base function value for the NURB curve.
  • interpolate
    This method interpolates tha data for the nurbs surface.
  • interpolateNurbs
    This method interpolates tha data for the nurbs curve.

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getSystemService (Context)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Socket (java.net)
    Provides a client-side TCP socket.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now