H3DU.SurfaceEval
H3DU.SurfaceEval()
Deprecated: Use H3DU.SurfaceBuilder instead.
An evaluator of parametric functions for generating vertex attributes of a surface.
See the Parametric Curves and Parametric Surfaces tutorial for more information.
Parameters
Methods
- color
Specifies a parametric surface function for generating color values. - evalOne
Generates vertex positions and attributes based on a point in a parametric surface. - evalSurface
Generates the vertex positions and attributes of a parametric surface. - normal
Specifies a parametric surface function for generating normals. - setAutoNormal
Sets whether this object will automatically generate normals rather than use the parametric evaluator specified for normal generation, if any. - texCoord
Specifies a parametric surface function for generating texture coordinates. - vertex
Specifies a surface evaluator object for generating the vertex positions of a parametric surface.
H3DU.SurfaceEval#color(evaluator)
Specifies a parametric surface function for generating color values.
Parameters
evaluator
(Type: Object)
An object that must contain a method namedevaluate
that takes a U coordinate and a V coordinate and returns a 3-element array.
Return Value
This object. (Type: H3DU.SurfaceEval)
H3DU.SurfaceEval#evalOne(mesh, u, v)
Generates vertex positions and attributes based on a point in a parametric surface.
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)
U coordinate of the surface to evaluate.v
(Type: number)
V coordinate of the surface to evaluate.
Return Value
This object. (Type: H3DU.SurfaceEval)
H3DU.SurfaceEval#evalSurface(mesh, [mode], [un], [vn], [u1], [u2], [v1], [v2])
Generates the vertex positions and attributes of a parametric surface.
Parameters
mesh
(Type: H3DU.Mesh)
The 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.mode
(Type: number) (optional)
If this value is H3DU.Mesh.TRIANGLES, or is null, undefined, or omitted, generates a series of triangles defining the surface. If this value is H3DU.Mesh.LINES, generates a series of lines defining the surface. If this value is H3DU.Mesh.POINTS, generates a series of points along the surface. For any other value, this method has no effect.un
(Type: number) (optional)
Number of subdivisions along the U axis. Default is 24.vn
(Type: number) (optional)
Number of subdivisions along the V axis. Default is 24.u1
(Type: number) (optional)
Starting U coordinate of the surface to evaluate. Default is the starting U coordinate given by the surface evaluator object, or 0 if not given.u2
(Type: number) (optional)
Ending U coordinate of the surface to evaluate. Default is the ending U coordinate given by the surface evaluator object, or 1 if not given.v1
(Type: number) (optional)
Starting V coordinate of the surface to evaluate. Default is the starting V coordinate given by the surface evaluator object, or 0 if not given.v2
(Type: number) (optional)
Ending V coordinate of the surface to evaluate. Default is the ending V coordinate given by the surface evaluator object, or 1 if not given.
Return Value
This object. (Type: H3DU.SurfaceEval)
H3DU.SurfaceEval#normal(evaluator)
Specifies a parametric surface function for generating normals.
Parameters
evaluator
(Type: Object)
An object that must contain a method namedevaluate
that takes a U coordinate and a V coordinate and returns a 3-element array.
Return Value
This object. (Type: H3DU.SurfaceEval)
H3DU.SurfaceEval#setAutoNormal(value)
Sets whether this object will automatically generate normals rather than use the parametric evaluator specified for normal generation, if any. By default, normals won't be generated automatically.
Parameters
value
(Type: Boolean)
Either true or false. True means normals will automatically be generated; false means they won't.
Return Value
This object. (Type: H3DU.SurfaceEval)
H3DU.SurfaceEval#texCoord(evaluator)
Specifies a parametric surface function for generating texture coordinates.
Parameters
evaluator
(Type: Object)
An object that must contain a method namedevaluate
that takes a U coordinate and a V coordinate and returns a 2-element array.
Return Value
This object. (Type: H3DU.SurfaceEval)
H3DU.SurfaceEval#vertex(evaluator)
Specifies a surface evaluator object for generating the vertex positions of a parametric surface.
Parameters
evaluator
(Type: H3DU.Surface | Object)
An object described in H3DU.Surface. Can be null, in which case, disables generating vertex positions.
Return Value
This object. (Type: H3DU.SurfaceEval)