H3DU.CurveEval
H3DU.CurveEval()
Deprecated: Use H3DU.CurveBuilder instead.
An evaluator of curve evaluator objects for generating vertex positions and colors of a curve.
For more information, see the Parametric Curves and Parametric Surfaces tutorial.
Methods
- color
Specifies a parametric curve function for generating color values. - evalCurve
Generates vertices and attribute values that follow a parametric curve function. - evalOne
Generates vertex positions and attributes based on a point in a parametric curve. - normal
Specifies a parametric curve function for generating normals. - texCoord
Specifies a parametric curve function for generating texture coordinates. - vertex
Specifies a curve evaluator object for generating the vertex positions of a parametric curve.
H3DU.CurveEval#color(evaluator)
Specifies a parametric curve function for generating color values.
Parameters
evaluator
(Type: Object)
An object that must contain a method namedevaluate
that takes a single U coordinate and returns a 3-element array.
Return Value
This object. (Type: H3DU.CurveEval)
H3DU.CurveEval#evalCurve(mesh, [mode], [n], [u1], [u2])
Generates vertices and attribute values that follow a parametric curve function.
Parameters
mesh
(Type: H3DU.Mesh)
A geometric mesh where the vertices will be generated.mode
(Type: number) (optional)
If this value is H3DU.Mesh.LINES, or is null, undefined, or omitted, generates a series of lines defining the curve. If this value is H3DU.Mesh.POINTS, generates a series of points along the curve. For any other value, this method has no effect.n
(Type: number) (optional)
Number of subdivisions of the curve to be drawn. Default is 24.u1
(Type: number) (optional)
Starting point of the curve. Default is the starting coordinate given by the curve evaluator object, or 0 if not given.u2
(Type: number) (optional)
Ending point of the curve. Default is the ending coordinate given by the curve evaluator object, or 1 if not given.
Return Value
This object. (Type: H3DU.CurveEval)
H3DU.CurveEval#evalOne(mesh, u)
Generates vertex positions and attributes based on a point in a parametric curve.
Parameters
mesh
(Type: H3DU.Mesh)
H3DU.Mesh where vertex positions and attributes will be generated. When this method returns, the current color, normal, and texture coordinates will be the same as they were before the method started.u
(Type: number)
Point of the curve to evaluate.
Return Value
This object. (Type: H3DU.CurveEval)
H3DU.CurveEval#normal(evaluator)
Specifies a parametric curve function for generating normals.
Parameters
evaluator
(Type: Object)
An object that must contain a method namedevaluate
that takes a single U coordinate and returns a 3-element array.
Return Value
This object. (Type: H3DU.CurveEval)
H3DU.CurveEval#texCoord(evaluator)
Specifies a parametric curve function for generating texture coordinates.
Parameters
evaluator
(Type: Object)
An object that must contain a method namedevaluate
that takes a single U coordinate and returns a 1- or 2-element array.
Return Value
This object. (Type: H3DU.CurveEval)
H3DU.CurveEval#vertex(evaluator)
Specifies a curve evaluator object for generating the vertex positions of a parametric curve.
Parameters
evaluator
(Type: H3DU.Curve | Object)
An object described in H3DU.Curve. Can be null, in which case, disables generating vertex positions.
Return Value
This object. (Type: H3DU.CurveEval)