Methods
- add
Light - advance
Incremental Selection - begin
Convex Polyhedron Selection - begin
Ray Drill Selection - begin
Screen Select ByArea - begin
Sphere Selection - center
Camera OnNode - clear
Lights - composite
Pick From Point - end
Comparison - end
Incremental Selection - fit
Bounding - fit
Nodes - fit
World - get
Ambient Light Color - get
Ambient Occlusion Enabled - get
Ambient Occlusion Radius - get
Anti Aliasing Mode - get
Axis Triad - get
Backfaces Visible - get
Background Color - get
Bloom Enabled - get
Bloom Intensity Scale - get
Bloom Layers - get
Bloom Threshold - get
Bloom Threshold Ramp Width - get
Bounding Calculation Ignores Invisible - get
Camera - get
Canvas Size - get
Draw Mode - get
Eye Dome Lighting Blur Edge Distance - get
Eye Dome Lighting Blur Interval - get
Eye Dome Lighting Blur Samples - get
Eye Dome Lighting Enabled - get
Eye Dome Lighting Opacity - get
Eye Dome Lighting Shading Edge Distance - get
Face Visibility - get
Full Camera Matrix - get
Gooch Base Color Prominence - get
Gooch Blue - get
Gooch Luminance Shift Strength - get
Gooch Yellow - get
Ground Plane - get
Hard Edge Color - get
Hard Edge Opacity - get
Hard Edge Threshold - get
Hard Edge Threshold Ramp Width - get
Hard Edges Enabled - get
Hidden Line Settings - get
Image Based Lighting Enabled - get
Image Based Lighting Intensity - get
Image Based Lighting Orientation - get
Interactive Draw Limit Increase Enabled - get
Lighting Enabled - get
Line Jitter Enabled - get
Line Jitter Frequency - get
Line Jitter Instance Count - get
Line Jitter Radius - get
Line Visibility - get
Nav Cube - get
Point Shape - get
Point Size - get
Projection Matrix - get
Projection Mode - get
Silhouette Color - get
Silhouette Enabled - get
Silhouette Opacity - get
Silhouette Threshold - get
Silhouette Threshold Ramp Width - get
Simple Reflection Attenuation - get
Simple Reflection Blur Interval - get
Simple Reflection Blur Samples - get
Simple Reflection Enabled - get
Simple Reflection Fade Angle - get
Simple Reflection Opacity - get
Simple Shadow Blur Interval - get
Simple Shadow Blur Samples - get
Simple Shadow Color - get
Simple Shadow Enabled - get
Simple Shadow Interactive Update Enabled - get
Simple Shadow Opacity - get
Simple Shadow Resolution - get
Toon Shading Band Count - get
Toon Shading Specular Factor - get
View Matrix - get
View Orientation Camera - isolate
Nodes - pick
All From Point - pick
All From Ray - pick
From Point - pick
From Ray - point
ToWindow Position - project
Point - raycast
From Point - remove
Light - reset
Camera - set
Ambient Light Color - set
Ambient Occlusion Enabled - set
Ambient Occlusion Radius - set
Anti Aliasing Mode - set
Backfaces Visible - set
Background Color - set
Bloom Enabled - set
Bloom Intensity Scale - set
Bloom Layers - set
Bloom Threshold - set
Bloom Threshold Ramp Width - set
Bounding Calculation Ignores Invisible - set
Camera - set
Display Incomplete Frames - set
Draw Mode - set
Eye Dome Lighting Blur Edge Distance - set
Eye Dome Lighting Blur Interval - set
Eye Dome Lighting Blur Samples - set
Eye Dome Lighting Enabled - set
Eye Dome Lighting Opacity - set
Eye Dome Lighting Shading Edge Distance - set
Face Visibility - set
Gooch Base Color Prominence - set
Gooch Blue - set
Gooch Luminance Shift Strength - set
Gooch Yellow - set
Ground Plane - set
Hard Edge Color - set
Hard Edge Opacity - set
Hard Edge Threshold - set
Hard Edge Threshold Ramp Width - set
Hard Edges Enabled - set
Image Based Lighting Enabled - set
Image Based Lighting Environment - set
Image Based Lighting Intensity - set
Image Based Lighting Orientation - set
Interactive Draw Delay - set
Interactive Draw Limit Increase Enabled - set
Lighting Enabled - set
Line Jitter Enabled - set
Line Jitter Frequency - set
Line Jitter Instance Count - set
Line Jitter Radius - set
Line Visibility - set
Point Shape - set
Point Size - set
Point Visibility Test - set
Projection Mode - set
Silhouette Color - set
Silhouette Enabled - set
Silhouette Opacity - set
Silhouette Threshold - set
Silhouette Threshold Ramp Width - set
Simple Reflection Attenuation - set
Simple Reflection Blur Interval - set
Simple Reflection Blur Samples - set
Simple Reflection Enabled - set
Simple Reflection Fade Angle - set
Simple Reflection Opacity - set
Simple Shadow Blur Interval - set
Simple Shadow Blur Samples - set
Simple Shadow Color - set
Simple Shadow Enabled - set
Simple Shadow Interactive Update Enabled - set
Simple Shadow Opacity - set
Simple Shadow Resolution - set
Statistics Display Visibility - set
Toon Shading Band Count - set
Toon Shading Specular Factor - set
Transparency Mode - set
View Orientation - setXRay
Color - setXRay
Opacity - setXRay
Transparency Mode - start
Comparison - test
Point Visibility - unproject
Point - unsetXRay
Color - update
Camera - update
Light
Methods
addLight
advanceIncrementalSelection
-
Returns the next batch of geometry selected by the supplied selection context.
Parameters
-
handle: IncrementalSelectionId
The handle to an active area selection context.
Returns Promise<NodeSelectionItem[] | null>
Returns selected items. If the resulting list is null then there are no more items to select.
-
advanceVolumeSelection
[deprecated]
-
Parameters
-
handle: IncrementalSelectionId
Returns Promise<NodeSelectionItem[] | null>
-
beginConvexPolyhedronSelection
-
Creates a new and active selection context for the provided selection volume. The selection volume is a convex polyhedron defined by the bounded intersection of its half-spaces.
Parameters
-
volumePlanes: Plane[]
The planes used to define volume. A point p is inside the volume if and only if (plane.determineSide(p) == true) for all supplied planes.
-
heuristicOrigin: Point3
A point used to compute distances against for prioritizing returned results. This is typically (but not necessarily) the center of the volume.
-
config: IncrementalPickConfig
The configuration object used for this selection operation.
Returns Promise<IncrementalSelectionId>
The handle for the selection context.
-
beginRayDrillSelection
-
Creates a new and active selection context for the provided selection ray. The ray is created at the supplied ray origin and is cast into the scene. Faces are selected if they lie along the ray. Lines and points are selected if they lie within the ray's box radius.
Note: Somewhat confusingly ray drill selection is actually a selection by volume. The provided ray origin and radius are used to create a frustum to preform the selection. This has some consequences. For example, the
SelectionResult
s returned by advancing a ray drill selection will not have selection positions, since they were not selected at a single point.Parameters
-
rayCssOrigin: Point2
The coordinate in CSS pixel space for the selection ray's origin.
-
rayCssBoxRadius: number
The radius around the ray in CSS pixel space used for line and point selection proximity.
-
config: IncrementalPickConfig
The configuration object used for this selection operation.
Returns Promise<IncrementalSelectionId>
The handle for the selection context.
-
beginScreenSelectByArea
-
Creates a new and active selection context for the provided selection window.
Parameters
-
areaCssMin: Point2
The minimum coodinate in CSS pixel space for the selection window.
-
areaCssMax: Point2
The maximum coodinate in CSS pixel space for the selection window.
-
config: IncrementalPickConfig
The configuration object used for this selection operation.
Returns Promise<IncrementalSelectionId>
The handle for the selection context.
-
beginSphereSelection
-
Creates a new and active selection context for the provided selection sphere.
Parameters
-
sphereCenter: Point3
The center of the selection sphere.
-
sphereRadius: number
The radius of the selection sphere.
-
config: IncrementalPickConfig
The configuration object used for this selection operation.
Returns Promise<IncrementalSelectionId>
The handle for the selection context.
-
centerCameraOnNode
clearLights
-
Removes all lights from the scene. When there are no lights, material colors are drawn at full intensity. This has the same visual effect as calling
setLightingEnabled(false)
.See also:
Returns void
compositePickFromPoint
-
Performs a composite picking operation. This operation will return all candidate Node entities according to the PickConfig.
Parameters
-
point: Point2
Canvas position to pick from.
-
config: PickConfig
The configuration object used for this picking operation.
Returns Promise<CompositeSelectionItem>
An object containing the result of the picking operation.
-
endComparison
-
Disables a visual comparison of two sets of nodes enabled by startComparison.
Returns void
endIncrementalSelection
-
Deactivates and destroys the provided selection context.
Parameters
-
handle: IncrementalSelectionId
The selection context to destroy.
Returns DeprecatedPromise
-
endVolumeSelection
[deprecated]
-
Parameters
-
handle: IncrementalSelectionId
Returns DeprecatedPromise
-
fitBounding
-
Fits the camera to the bounding box.
Parameters
-
bounding: Box
bounding box to fit the camera.
-
Optional duration: number
Time in milliseconds for the camera transition to the new camera view.
-
Optional camera: Camera
Returns Promise<void>
A promise that will be resolved once the transition is complete.
-
fitNodes
-
Fits the camera to the bounding box containing the node ids.
Parameters
-
ids: NodeId[]
-
Optional duration: number
Time in milliseconds for the camera transition to the new camera view.
Returns Promise<void>
A promise that will be resolved once the transition is complete.
-
fitWorld
-
Fits the view to the model bounding box.
Parameters
-
Optional duration: number
the number of milliseconds to transition to the new camera.
-
Optional camera: Camera
Returns Promise<void>
A promise that will be resolved once the transition is complete.
-
getAmbientLightColor
-
Gets the color of the ambient light applied to the scene.
See also setAmbientLightColor.
Returns Color
getAmbientOcclusionEnabled
-
Returns boolean
boolean value indicating whether ambient occlusion is enabled
getAmbientOcclusionRadius
-
Returns number
the ambient occlusion radius
getAntiAliasingMode
-
Gets the anti-aliasing mode for the scene. The Default value is AntiAliasingMode.SMAA
Returns AntiAliasingMode
the current anti-aliasing mode.
getAxisTriad
-
Returns AxisTriad
getBackfacesVisible
-
Gets whether backfaces are being rendered in the scene.
Returns boolean
Boolean value indicating whether backfaces are being rendered in the scene.
getBackgroundColor
-
Returns the background colors of the canvas.
Returns VerticalGradient
the canvas background colors.
getBloomEnabled
-
Returns whether bloom is enabled.
See setBloomEnabled.
Returns boolean
getBloomIntensityScale
-
Gets the intensity of the bloom effect.
Returns number
getBloomLayers
-
Returns an array of objects describing each layer in the bloom effect.
See setBloomLayers.
Returns BloomLayerInfo[]
getBloomThreshold
-
Returns the minimum luminance value a pixel must have for it to contribute to bloom.
Returns number
getBloomThresholdRampWidth
-
Returns how much greater than the threshold set by setBloomThreshold a pixel's luminance value must be before it contributes fully to the bloom effect.
Returns number
getBoundingCalculationIgnoresInvisible
-
Returns boolean
whether or not bounding calculations by this View object ignores invisible geometry.
getCamera
-
Gets the current camera
Returns Camera
the current camera
getCanvasSize
-
Returns the size of the viewer canvas.
Returns Point2
the current size of the viewer canvas.
getDrawMode
-
Returns DrawMode
The current draw mode
getEyeDomeLightingBlurEdgeDistance
-
Returns a value that controls the maximum Z-distance between samples taken by the blur filter used in eye-dome lighting for point clouds. The value is a proportion of the screen size.
Returns Promise<number>
getEyeDomeLightingBlurInterval
-
Returns the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds.
Returns Promise<number>
getEyeDomeLightingBlurSamples
-
Returns the diameter of the blur filter used in eye-dome lighting for point clouds. A value of 0 means that blurring is disabled.
Returns Promise<number>
getEyeDomeLightingEnabled
-
Returns Promise<boolean>
boolean value indicating if eye-dome lighting is enabled or disabled.
getEyeDomeLightingOpacity
-
Returns the opacity of the shading rendered by eye-dome lighting for point clouds. The value is in the range [0,1].
Returns Promise<number>
getEyeDomeLightingShadingEdgeDistance
-
Returns a value that controls the shading contrast in eye-dome lighting for point clouds. The value is a number of pixels.
Returns Promise<number>
getFaceVisibility
-
Gets the face visibility for the view.
Returns boolean
whether faces are currently being drawn.
getFullCameraMatrix
-
This is equivalent to (projectionMatrix * viewMatrix).
Returns Matrix
The current full camera matrix.
getGoochBaseColorProminence
-
Gets the prominence of the object's base color in Gooch shading.
Returns number
getGoochBlue
-
Gets the value to use as the blue tone in Gooch shading.
Returns number
getGoochLuminanceShiftStrength
-
Gets the strength of the luminance shift in Gooch shading.
Returns number
getGoochYellow
-
Gets the value to use as the yellow tone in Gooch shading.
Returns number
getGroundPlane
-
Returns information about the invisible ground plane onto which simple shadows and reflections are projected.
See also:
Returns GroundPlane
getHardEdgeColor
-
Returns Color
getHardEdgeOpacity
-
Returns number
getHardEdgeThreshold
-
Returns the angle threshold for hard edges. Edges will be drawn between two faces whose normals diverge beyond this angle.
See also:
Returns number
getHardEdgeThresholdRampWidth
-
Returns the value set by setHardEdgeThresholdRampWidth.
This value is added to the one set by setHardEdgeThreshold to create a secondary threshold. Angles greater than the secondary threshold will result in edges with full opacity, and angles between the two thresholds will result in edges with reduced opacity.
A value of
0
means that all edges are drawn at full opacity.See also:
Returns number
getHardEdgesEnabled
-
Returns whether hard edges are enabled. Hard edges are edges between two faces whose normals diverge beyond a given angle.
Hard edges are always enabled in hidden line mode, regardless of the return value.
See setHardEdgesEnabled.
Returns boolean
getHiddenLineSettings
-
Returns HiddenLineSettings
a Settings.HiddenLineSettings object.
getImageBasedLightingEnabled
-
Returns whether image-based lighting is enabled for physically-based materials.
See also:
Returns boolean
getImageBasedLightingIntensity
-
Returns the intensity (brightness) of image-based lighting applied to physically-based materials.
The default value is 1.
See also:
Returns number
getImageBasedLightingOrientation
-
Returns the orientation of the image-based lighting environment applied to physically-based materials.
See also:
Returns ImageBasedLightingOrientation
getInteractiveDrawLimitIncreaseEnabled
-
Gets whether or not the viewer will periodically attempt to increase the amount drawn during interaction.
Returns Promise<boolean>
boolean value indicating whether this feature is enabled or not
getLightingEnabled
-
Returns whether lighting is enabled.
See also setLightingEnabled.
Returns boolean
getLineJitterEnabled
-
Returns whether line jitter is enabled.
Line jitter makes lines look 'sketchy' by drawing them multiple times with randomized offsets applied to the vertices.
See also:
Returns boolean
getLineJitterFrequency
-
Returns the frequency of the noise used to offset line vertices when line jitter is enabled. The default value is 5.
See also:
Returns number
getLineJitterInstanceCount
-
Returns the number of times lines are drawn when line jitter is enabled. The default value is 4.
See also:
Returns number
getLineJitterRadius
-
Returns the radius of the random offset applied to line vertices when line jitter is enabled. The default value is 0.005.
The value is specified as a proportion of the canvas height, where 1 means the full height of the canvas.
See also:
Returns number
getLineVisibility
-
Gets the line visibility for the view.
Returns boolean
whether lines are currently being drawn.
getNavCube
-
Returns NavCube
getPointShape
-
Gets the PointShape. See PointShape
Returns Promise<PointShape>
getPointSize
-
Gets the diameter of rendered points. See PointSizeUnit.
Returns Promise<[number, PointSizeUnit]>
getProjectionMatrix
-
Gets the projection matrix.
Returns Matrix
The current projection matrix.
getProjectionMode
-
Gets the projection mode.
Returns Projection
The current projection mode.
getSilhouetteColor
-
Returns Color
getSilhouetteEnabled
-
Returns whether silhouette edges are enabled.
Silhouette edges are always enabled in hidden line mode, regardless of the return value.
See setSilhouetteEnabled.
Returns boolean
getSilhouetteOpacity
-
Returns number
getSilhouetteThreshold
-
Returns the distance threshold for silhouette edges. This value affects the minimum z-distance required between two pixels for an edge to be drawn. A smaller value will result in more edges being drawn on finer details.
The value is a proportion of the canvas size and not a world-space distance.
See also:
Returns number
getSilhouetteThresholdRampWidth
-
Returns the value set by setSilhouetteThresholdRampWidth.
This value is added to the one set by setSilhouetteThreshold to create a secondary threshold. Distances greater than the secondary threshold will result in edges with full opacity, and distances between the two thresholds will result in edges with reduced opacity.
A value of
0
means that all edges are drawn at full opacity.See also:
Returns number
getSimpleReflectionAttenuation
-
Returns properties that control how objects drawn in simple reflections fade as they move further from the ground plane.
Attenuation begins at
nearDistance
and increases linearly such that the model is not visible in the reflection beyondfarDistance
.Attenuation is disabled if
farDistance
is less than or equal tonearDistance
.See also:
Returns object
An object with the following properties:
-
far
Distance: number The distance from the ground plane at which the model is completely faded.
-
near
Distance: number The distance from the ground plane at which the model begins to fade.
-
unit: SimpleReflectionAttenuationUnit
The unit in which
nearDistance
andfarDistance
are specified.
-
getSimpleReflectionBlurInterval
-
Returns the distance between samples taken by the blur filter used for simple reflections.
See also:
Returns [number, BlurIntervalUnit]
getSimpleReflectionBlurSamples
-
Returns the diameter of the blur filter used for simple reflections. A value less than or equal to
1
means that blurring is disabled.See also:
Returns number
getSimpleReflectionEnabled
-
Returns whether simple reflections are enabled.
Returns boolean
getSimpleReflectionFadeAngle
-
Returns the angle, in degrees, between the view vector and the ground plane at which simple reflections begin to fade.
A value to
0
means that the fading effect is disabled.Regardless of the value, simple reflections will not be drawn if the camera is below the ground plane.
See also:
Returns number
getSimpleReflectionOpacity
-
Returns the opacity of simple reflections.
See also:
Returns number
getSimpleShadowBlurInterval
-
Returns the distance in pixels between samples taken by the blur filter used for simple shadows.
See also:
Returns number
getSimpleShadowBlurSamples
-
Returns the diameter of the blur filter used for simple shadows.
See also:
Returns number
getSimpleShadowColor
-
Returns Color
getSimpleShadowEnabled
-
Returns whether simple shadows are enabled.
Returns boolean
getSimpleShadowInteractiveUpdateEnabled
-
Returns whether simple shadows will be updated during user interaction.
See also:
Returns boolean
getSimpleShadowOpacity
-
Returns number
getSimpleShadowResolution
-
Returns the width and height in pixels of the texture image into which simple shadows are drawn.
See also:
Returns number
getToonShadingBandCount
-
Gets the current number of discrete shading bands that will be used when toon shading is enabled.
Returns number
getToonShadingSpecularFactor
-
Gets the current toon shading specular scale factor.
Returns number
getViewMatrix
-
Gets the view matrix.
Returns Matrix
The current view matrix.
getViewOrientationCamera
-
Returns a camera set to a ViewOrientation
Parameters
-
orientation: ViewOrientation
The desired view orientation for the camera.
-
Optional bounding: Box
Optional bounding to fit the camera about. If not supplied, the model bounding will be used.
-
Optional preserveModelUp: boolean
Returns Promise<Camera>
-
isolateNodes
-
Hides all nodes except those specified. Also fits the camera to those nodes' bounding box.
Parameters
-
nodeIds: NodeId[]
An array of the node IDs to be isolated.
-
Optional duration: number
Time in milliseconds for the camera transition to the new camera view.
-
Optional fitNodes: boolean
If true, then the view is fitted around the isolated nodes.
-
Optional initiallyHiddenStayHidden: boolean | null
Controls whether or not initially hidden geometries stay hidden. Default behavior is driven by setBehaviorInitiallyHidden.
Returns Promise<void>
-
pickAllFromPoint
-
Performs a picking operation from the given position on the canvas. All candidate entities are returned. This method does not trigger a selection event. This method will reject if the point is outside the canvas area.
Parameters
-
point: Point2
Canvas position to pick from.
-
config: PickConfig
The configuration object used for this picking operation.
Returns Promise<NodeEntitySelectionItem[]>
An object containing the result of the picking operation.
-
pickAllFromRay
-
Performs a selection operation from the given world-space ray. All candidate entities are returned. This method does not trigger a selection event.
Parameters
-
ray: Ray
The world-space ray to perform the selection with.
-
config: PickConfig
The configuration object used for this picking operation.
Returns Promise<NodeEntitySelectionItem[]>
An object containing the result of the picking operation.
-
pickFromPoint
-
Performs a picking operation from the given position on the canvas. The best candidate entity is be returned. This method does not trigger a selection event. This method will reject if the point is outside the canvas area.
Parameters
-
point: Point2
Canvas position to pick from.
-
config: PickConfig
The configuration object used for this picking operation.
Returns Promise<SelectionItem>
An object containing the result of the picking operation.
-
pickFromRay
-
Performs a selection operation from the given world-space ray. The best candidate entity is be returned. This method does not trigger a selection event.
Parameters
-
ray: Ray
The world-space ray to perform the selection with.
-
config: PickConfig
The configuration object used for this picking operation.
Returns Promise<SelectionItem>
An object containing the result of the picking operation.
-
pointToWindowPosition
projectPoint
raycastFromPoint
removeLight
-
Parameters
-
key: LightKey
Returns void
-
resetCamera
-
Resets the camera to the initial view of the model when first loaded.
Parameters
-
Optional duration: number
the amount of time in milliseconds that the camera transition between the current and initial view should take.
Returns Promise<void>
-
setAmbientLightColor
-
Sets the color of the ambient light applied to the scene. This is a constant source of light that affects every point in the scene in the same way regardless of position or surface normal.
See also getAmbientLightColor.
Parameters
-
value: Color
Returns void
-
setAmbientOcclusionEnabled
-
Sets whether ambient occlusion is enabled
Parameters
-
Optional enabled: boolean
sets whether ambient occlusion will be enabled
Returns DeprecatedPromise
-
setAmbientOcclusionRadius
-
Sets the ambient occlusion radius. This value represents the maximum screen-proportional distance between two points such that one will cast a shadow on the other.
Parameters
-
radius: number
the ambient occlusion radius.
Returns DeprecatedPromise
-
setAntiAliasingMode
-
Sets the anti-aliasing mode for the scene.
Parameters
-
antiAliasingMode: AntiAliasingMode
Returns DeprecatedPromise
-
setBackfacesVisible
-
Sets whether backfaces should be rendered in the scene.
Parameters
-
visible: boolean
Boolean value indicating whether backfaces should be rendered.
Returns DeprecatedPromise
Promise that is resolved when this operation has completed.
-
setBackgroundColor
-
Sets the viewer background color to a gradient interpolating from the top to bottom color. For a solid color, the top and bottom color should have the same values. Background Transparency is only available with client-side rendering. To re-enable a transparent background, pass null to the parameters of this function.
Parameters
-
Optional top: Color | null
the top color for the the background gradient.
-
Optional bottom: Color | null
the bottom color for the the background gradient.
Returns DeprecatedPromise
a promise that resolves when the operation has completed.
-
setBloomEnabled
-
Sets whether bloom is enabled.
See getBloomEnabled.
Parameters
-
Optional value: boolean
Returns void
-
setBloomIntensityScale
-
Sets the intensity of the bloom effect. This value is multiplied by the intensities of the individual layers set by setBloomLayers.
Parameters
-
value: number
Returns void
-
setBloomLayers
-
Sets the number of layers in the bloom effect and the layers' attributes.
The bloom effect is achieved by applying a luminance filter to the source image, then progressively downsampling, blurring, and adding the results together. The result of each downsample/blur operation is fed into the next, which is executed at half the resolution of the previous. The number of stages and the behavior of each stage are controlled by this function.
See BloomLayerInfo, getBloomLayers.
Parameters
-
layers: BloomLayerInfo[]
Returns void
-
setBloomThreshold
-
Sets the minimum luminance value a pixel must have for it to contribute to bloom. The value should be in the range
[0,1]
.Parameters
-
value: number
Returns void
-
setBloomThresholdRampWidth
-
Sets how much greater than the threshold set by setBloomThreshold a pixel's luminance value must be before it contributes fully to the bloom effect.
If the pixel's luminance value does not exceed the threshold by at least the amount set by this function, the pixel's contribution will be diminished based on how close its luminance value is to the threshold.
Parameters
-
value: number
Returns void
-
setBoundingCalculationIgnoresInvisible
-
Sets whether or not bounding calculations by this View object ignores invisible geometry.
Parameters
-
value: boolean
Returns void
-
setCamera
-
Sets the current camera
Parameters
-
camera: Camera | null
the camera to set
-
Optional duration: number
camera transition time in milliseconds
Returns boolean
-
setDisplayIncompleteFrames
-
Sets whether intermediate frames of an incremental draw will be displayed. (default: true)
If false, the image will only be displayed once completely drawn, except immediately after certain operations, such as setting the camera. To disable these exceptions, call setInteractiveDrawDelay with a value of 0.
Parameters
-
value: boolean
Returns DeprecatedPromise
-
setDrawMode
-
Sets the drawing mode for the scene.
Parameters
-
drawMode: DrawMode
The drawing mode to set.
Returns DeprecatedPromise
-
setEyeDomeLightingBlurEdgeDistance
-
Controls the maximum Z-distance between samples taken by the blur filter used in eye-dome lighting for point clouds. The value is taken as a proportion of the screen size. Decreasing the value will result in sharper edges, and increasing the value will result in softer edges. (default: .03)
Parameters
-
value: number
Returns DeprecatedPromise
-
setEyeDomeLightingBlurInterval
-
Sets the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds. (default: 1)
Parameters
-
value: number
Returns DeprecatedPromise
-
setEyeDomeLightingBlurSamples
-
Sets the diameter of the blur filter used in eye-dome lighting for point clouds. Setting the value to 0 will disable blurring. (default: 7)
Parameters
-
value: number
Returns DeprecatedPromise
-
setEyeDomeLightingEnabled
-
Enables or disables eye-dome lighting for point clouds. (default: disabled)
Parameters
-
Optional enabled: boolean
Returns DeprecatedPromise
-
setEyeDomeLightingOpacity
-
Sets the opacity of the shading rendered by eye-dome lighting for point clouds. (default: 1)
Parameters
-
value: number
A number in the range [0,1].
Returns DeprecatedPromise
-
setEyeDomeLightingShadingEdgeDistance
-
Controls the shading contrast in eye-dome lighting for point clouds. The value is taken as a number of pixels. Increasing the value will result in overall lighter shading, and decreasing the value will result in overall darker shading. (default: 2)
Parameters
-
value: number
Returns DeprecatedPromise
-
setFaceVisibility
-
Sets the face visibility for the view.
Parameters
-
faceVisibility: boolean
indicates whether to draw faces.
Returns DeprecatedPromise
-
setGoochBaseColorProminence
-
Sets the prominence of the object's base color in Gooch shading.
Parameters
-
prominence: number
this scalar value determines the amount of the object's base color is applied to the final shaded color.
Returns void
-
setGoochBlue
-
Sets the value to use as the blue tone in Gooch shading.
Parameters
-
blue: number
the blue tone. This value should be in the range [0,1]
Returns void
-
setGoochLuminanceShiftStrength
-
Sets the strength of the luminance shift in Gooch shading.
Parameters
-
shiftStrength: number
this scalar values determines the amount of luminance shift that is applied to the object's base color
Returns void
-
setGoochYellow
-
Sets the value to use as the yellow tone in Gooch shading.
Parameters
-
yellow: number
the yellow tone. This value should be in the range [0,1]
Returns void
-
setGroundPlane
-
Defines the invisible ground plane onto which simple shadows and reflections are projected.
See also:
Parameters
-
plane: GroundPlane
The plane to set.
Returns void
-
setHardEdgeColor
-
Parameters
-
value: Color
The color to set.
Returns void
-
setHardEdgeOpacity
-
Parameters
-
value: number
The opacity to set.
Returns void
-
setHardEdgeThreshold
-
Sets the angle threshold for hard edges. Edges will be drawn between two faces whose normals diverge beyond this angle.
See also:
Parameters
-
degrees: number
The threshold to set.
Returns void
-
setHardEdgeThresholdRampWidth
-
Controls how quickly edges fade as the angle between adjacent faces decreases.
This value is added to the one set by setHardEdgeThreshold to create a secondary threshold. Angles greater than the secondary threshold will result in edges with full opacity, and angles between the two thresholds will result in edges with reduced opacity.
Setting this value to
0
will cause all edges to be drawn at full opacity.See also:
Parameters
-
degrees: number
Returns void
-
setHardEdgesEnabled
-
Enables or disables hard edges. Hard edges are edges between two faces whose normals diverge beyond a given angle.
Hard edges are always enabled in hidden line mode.
See also:
Parameters
-
Optional value: boolean
Whether hard edges should be enabled.
Returns void
-
setImageBasedLightingEnabled
-
Sets whether image-based lighting is enabled for physically-based materials.
See also:
Parameters
-
value: boolean
Returns void
-
setImageBasedLightingEnvironment
-
Sets the environment image used by image-based lighting applied to physically-based materials.
Passing
null
will cause the default environment image to be used.The image should be a cube map in KTX2 format with a space-separated list of spherical harmonics coefficients stored under the "sh" metadata key.
A compatible image can be created from an equirectangular source image (such as those found at HDRI Haven) with the following process:
- cmgen: https://github.com/google/filament
- ktx2ktx2, ktx2sc: https://github.com/KhronosGroup/KTX-Software/
cmgen -x out --format=ktx --size=256 in.hdr ktx2ktx2 -o uncompressed.ktx2 out/out_ibl.ktx ktxsc --zcmp 20 -o out.ktx2 uncompressed.ktx2
Parameters
-
data: Uint8Array | null
Returns void
setImageBasedLightingIntensity
-
Sets the intensity (brightness) of image-based lighting applied to physically-based materials.
The default value is 1.
See also:
Parameters
-
value: number
Returns void
-
setImageBasedLightingOrientation
-
Sets the orientation of the image-based lighting environment applied to physically-based materials.
See also:
Parameters
Returns void
setInteractiveDrawDelay
-
Sets how long after certain operations, such as setting the camera, to wait before starting a redraw. This delay exists in order to prevent flicker during continuous interaction. The initial value is 200ms.
Parameters
-
value: number
The delay in milliseconds
Returns DeprecatedPromise
-
setInteractiveDrawLimitIncreaseEnabled
-
Sets whether or not the viewer will periodically attempt to increase the amount drawn during interaction. Setting this to
false
may improve periodic framerate dips caused by such adjustments.Parameters
-
enable: boolean
Returns void
-
setLightingEnabled
-
Sets whether lighting is enabled. When disabled, material colors are drawn at full intensity.
See also InstanceModifier.DoNotLight, clearLights.
Parameters
-
Optional enabled: boolean
Returns DeprecatedPromise
-
setLineJitterEnabled
-
Sets whether line jitter is enabled.
Line jitter makes lines look 'sketchy' by drawing them multiple times with randomized offsets applied to the vertices.
See also:
Parameters
-
Optional value: boolean
Returns void
-
setLineJitterFrequency
-
Sets the frequency of the noise used to offset line vertices when line jitter is enabled. The default value is 5.
Decreasing this value causes lines to appear smoother, while increasing it causes lines to look more noisy.
See also:
Parameters
-
value: number
Returns void
-
setLineJitterInstanceCount
-
Sets the number of times lines are drawn when line jitter is enabled. The default value is 4.
Increasing this number can make the lines look more 'sketchy.'
See also:
Parameters
-
value: number
Returns void
-
setLineJitterRadius
-
Sets the radius of the random offset applied to line vertices when line jitter is enabled. The default value is 0.005.
The value is specified as a proportion of the canvas height, where 1 means the full height of the canvas.
See also:
Parameters
-
value: number
Returns void
-
setLineVisibility
-
Sets the line visibility for the view.
Parameters
-
lineVisibility: boolean
indicates whether to draw lines.
Returns DeprecatedPromise
-
setPointShape
-
Controls the appearance of rendered points. (default: Square) See PointShape.
Parameters
-
shape: PointShape
Returns DeprecatedPromise
-
setPointSize
-
Sets the diameter of rendered points. (default: 1, ScreenPixels) See PointSizeUnit.
Parameters
-
size: number
-
unit: PointSizeUnit
Returns DeprecatedPromise
-
setPointVisibilityTest
-
Sets a list of points whose visibility will be tested every time a frame is drawn by comparing them to the frame's depth buffer. Points that are partially obscured by transparent objects are considered visible.
The results are passed to the CallbackMap.frameDrawn callback so that UI elements may be updated in sync with rendering.
See also testPointVisibility.
Parameters
-
points: Point3[]
The points to test. An empty array will disable the test.
Returns void
-
setProjectionMode
-
Sets the projection mode.
Parameters
-
projectionMode: Projection
Returns void
-
setSilhouetteColor
-
Parameters
-
value: Color
The color to set.
Returns void
-
setSilhouetteEnabled
-
Enables or disables silhouette edges.
Silhouette edges are always enabled in hidden line mode.
See also:
Parameters
-
Optional value: boolean
Whether silhouette edges should be enabled.
Returns void
-
setSilhouetteOpacity
-
Parameters
-
value: number
The opacity to set.
Returns void
-
setSilhouetteThreshold
-
Sets the distance threshold for silhouette edges. This value affects the minimum z-distance required between two pixels for an edge to be drawn. A smaller value will result in more edges being drawn on finer details.
The value is a proportion of the canvas size and not a world-space distance.
See also:
Parameters
-
value: number
The threshold to set.
Returns void
-
setSilhouetteThresholdRampWidth
-
Controls how quickly edges fade as z-distance between pixels decreases.
This value is added to the one set by setSilhouetteThreshold to create a secondary threshold. Distances greater than the secondary threshold will result in edges with full opacity, and distances between the two thresholds will result in edges with reduced opacity.
Setting this value to
0
will cause all edges to be drawn at full opacity.See also:
Parameters
-
value: number
Returns void
-
setSimpleReflectionAttenuation
-
Controls how objects drawn in simple reflections fade as they move further from the ground plane.
Attenuation begins at
nearDistance
and increases linearly such that the model is not visible in the reflection beyondfarDistance
.Attenuation is disabled if
farDistance
is less than or equal tonearDistance
.See also:
Parameters
-
nearDistance: number
The distance from the ground plane at which objects begin to fade.
-
farDistance: number
The distance from the ground plane at which objects are completely faded.
-
Optional unit: SimpleReflectionAttenuationUnit
The unit in which
nearDistance
andfarDistance
are specified. If unspecified, SimpleReflectionAttenuationUnit.World will be used.
Returns void
-
setSimpleReflectionBlurInterval
-
Sets the distance between samples taken by the blur filter used for simple reflections.
See also:
Parameters
-
value: number
The interval to set.
-
Optional unit: BlurIntervalUnit
The unit in which the
value
argument is specified.
Returns void
-
setSimpleReflectionBlurSamples
-
Sets the diameter of the blur filter used for simple reflections. Setting the value less than or equal to
1
will disable blurring.See also:
Parameters
-
value: number
Returns void
-
setSimpleReflectionEnabled
-
Enables or disables simple reflections projected onto an invisible ground plane.
See also:
Parameters
-
Optional value: boolean
Returns void
-
setSimpleReflectionFadeAngle
-
Sets the angle, in degrees, between the view vector and the ground plane at which simple reflections begin to fade.
Settings the value to
0
will disable the fading effect.Regardless of the value, simple reflections will not be drawn if the camera is below the ground plane.
See also:
Parameters
-
degrees: number
The angle in degrees.
Returns void
-
setSimpleReflectionOpacity
-
Sets the opacity of simple reflections.
See also:
Parameters
-
value: number
Returns void
-
setSimpleShadowBlurInterval
-
Sets the distance in pixels between samples taken by the blur filter used for simple shadows.
See also:
Parameters
-
value: number
The interval to set.
Returns void
-
setSimpleShadowBlurSamples
-
Sets the diameter of the blur filter used for simple shadows. Setting the value to
0
will disable blurring.See also:
Parameters
-
value: number
The number of samples.
Returns void
-
setSimpleShadowColor
-
Parameters
-
color: Color
The color to set.
Returns void
-
setSimpleShadowEnabled
-
Enables or disables a full-scene shadow projected onto an invisible ground plane.
See also:
Parameters
-
Optional value: boolean
Whether simple shadows should be enabled.
Returns void
-
setSimpleShadowInteractiveUpdateEnabled
-
Enables or disables updates to simple shadows during user interaction.
See also:
Parameters
-
Optional value: boolean
Returns void
-
setSimpleShadowOpacity
-
Parameters
-
opacity: number
The opacity to set.
Returns void
-
setSimpleShadowResolution
-
Sets the width and height in pixels of the texture image into which simple shadows are drawn.
See also:
Parameters
-
pixels: number
The resolution to set.
Returns void
-
setStatisticsDisplayVisibility
-
Sets the display for the default statistic overlay.
Parameters
-
visibility: boolean
Returns Promise<void>
-
setToonShadingBandCount
-
Sets the number of discrete shading bands that will be used when toon shading is enabled. Each band represents a shade between dark and light which will control the final color of the pixel based on its light intensity. The default band count is 3.
Parameters
-
bandCount: number
Returns void
-
setToonShadingSpecularFactor
-
Sets a scale factor which controls the size of specular highlights when toon shading is enabled. The default value is 1.0.
Parameters
-
specularFactor: number
Returns void
-
setTransparencyMode
-
Sets how transparent objects are blended.
Parameters
-
mode: TransparencyMode
Returns void
-
setViewOrientation
-
Sets the view to a standard orientation.
Parameters
-
orientation: ViewOrientation
The desired view orientation for the camera.
-
Optional duration: number
The number of milliseconds used to transition to the new camera.
-
Optional bounding: Box
Optional bounding to fit the camera about. If not supplied, the model bounding will be used.
-
Optional preserveModelUp: boolean
Indicates whether the camera up will be set according to model up or current camera.
Returns Promise<void>
-
setXRayColor
-
Sets the color applied to nodes in x-ray mode. By default, the color is unset.
See unsetXRayColor.
Parameters
-
element: ElementType
the type of geometry to apply the color to
-
color: Color
the color to apply
-
Optional group: XRayGroup
the category of nodes that will be affected. If unspecified, XRayGroup.Selected will be used.
Returns DeprecatedPromise
-
setXRayOpacity
-
Sets the opacity of unselected items in x-ray mode.
Parameters
-
opacity: number
a number between 0 and 1
-
Optional element: ElementType
the type of element to which the opacity will apply. If unspecified, the opacity will apply to all element types.
Returns DeprecatedPromise
-
setXRayTransparencyMode
-
Sets how transparent (unselected) objects are blended in x-ray mode.
Parameters
-
mode: XRayTransparencyMode
Returns DeprecatedPromise
-
startComparison
-
Enables a visual comparison of two sets of nodes. The nodes specified by
nodeIdSet1
are filled with one color, the nodes specified bynodeIdSet2
with another color, and overlapping areas are filled with a third color.See endComparison.
Parameters
-
nodeIdSet1: NodeId[]
the nodes to compare against
nodeIdSet2
-
nodeIdSet2: NodeId[]
the nodes to compare against
nodeIdSet1
-
Optional config: ComparisonConfig
settings controlling the behavior of the comparison
Returns void
-
testPointVisibility
-
Tests whether the given points are visible by comparing them to the depth buffer of the most-recently-drawn frame. Points that are partially obscured by transparent objects are considered visible.
If the test is to be run every time a frame is drawn, setPointVisibilityTest should be used instead for proper synchronization.
Parameters
-
points: Point3[]
The points to test.
Returns Promise<number[]>
A list of indices of the visible points.
-
unprojectPoint
unsetXRayColor
-
Unsets the color applied to selected items in x-ray mode. Selected items will be displayed without overriding their colors.
See setXRayColor.
Parameters
-
element: ElementType
the type of geometry affected by the change
-
Optional group: XRayGroup
the category of nodes that will be affected. If unspecified, XRayGroup.Selected will be used.
Returns Promise<void>
-
Object representing the view associated to a model. All major functionality that affects how a model is rendered including the currently active camera, the view mode and other functionality like selection are part of this object.