wantNormals

Accessor

Controls whether normals are generated for surfaces. Normals allow 3d geometry to receive lighting; without them the geometry will be unaffected by lighting. By default, normals are not generated. Changing this value only affects subsequently-added geometry. For example:

 builder.wantNormals = true;
 builder.addShape(shapePoints); // this shape will have normals
 builder.wantNormals = false;
 builder.addLoop(loop); // this loop will have no normals
 const graphic = builder.finish(); // the result contains a shape with normals and a loop with no normals.

get: boolean

note Currently, no API exists to generate normals for a Polyface that lacks them. Until such an API becomes available, if you want a lit Polyface, you must both set wantNormals to true and supply a Polyface with precomputed normals to addPolyface.

see GraphicType for a description of whether and how different types of graphics are affected by lighting.


Setter

Controls whether normals are generated for surfaces. Normals allow 3d geometry to receive lighting; without them the geometry will be unaffected by lighting. By default, normals are not generated. Changing this value only affects subsequently-added geometry. For example:

 builder.wantNormals = true;
 builder.addShape(shapePoints); // this shape will have normals
 builder.wantNormals = false;
 builder.addLoop(loop); // this loop will have no normals
 const graphic = builder.finish(); // the result contains a shape with normals and a loop with no normals.

set(_wantNormals: boolean): void

note Currently, no API exists to generate normals for a Polyface that lacks them. Until such an API becomes available, if you want a lit Polyface, you must both set wantNormals to true and supply a Polyface with precomputed normals to addPolyface.

see GraphicType for a description of whether and how different types of graphics are affected by lighting.

Parameter Type Description
_wantNormals boolean  

Defined in

Last Updated: 14 October, 2020