View

class View()

Accessors

  • axisTriad
  • id
  • inputMonitor
  • navCube

Methods


Properties

View.domElements
Type:DomElements
View.floorplanManager
Type:FloorplanManager
View.operatorManager
Type:OperatorManager
View.overlayManager
Type:OverlayManager

Accessors

axisTriad()
Return type:AxisTriad
id()
Return type:number
inputMonitor()
Return type:InputMonitor
navCube()
Return type:NavCube

Methods

addLight

View.addLight(light)
Arguments:

Adds a light to the scene. The returned promise may be rejected if there are too many lights in the scene. See [[Light]].

See also:
  • [[clearLights]]
  • [[removeLight]]
  • [[updateLight]]
  • [[setAmbientLightColor]]
Return type:Promise <LightKey>

advanceIncrementalSelection

View.advanceIncrementalSelection(handle)
Arguments:
  • handle (IncrementalSelectionId()) – The handle to an active area selection context.

Returns the next batch of geometry selected by the supplied selection context.

Returns:Returns selected items. If the resulting list is null then there are no more items to select.
Return type:Promise <null | [NodeSelectionItem]>

beginConvexPolyhedronSelection

View.beginConvexPolyhedronSelection(volumePlanes, heuristicOrigin, config)
Arguments:
  • 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.

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.

Returns:The handle for the selection context.
Return type:Promise <IncrementalSelectionId>

beginRayDrillSelection

View.beginRayDrillSelection(rayCssOrigin, rayCssBoxRadius, config)
Arguments:
  • 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.

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.

Returns:The handle for the selection context.
Return type:Promise <IncrementalSelectionId>

beginScreenSelectByArea

View.beginScreenSelectByArea(areaCssMin, areaCssMax, config)
Arguments:
  • 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.

Creates a new and active selection context for the provided selection window.

Returns:The handle for the selection context.
Return type:Promise <IncrementalSelectionId>

beginSphereSelection

View.beginSphereSelection(sphereCenter, sphereRadius, config)
Arguments:
  • 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.

Creates a new and active selection context for the provided selection sphere.

Returns:The handle for the selection context.
Return type:Promise <IncrementalSelectionId>

centerCameraOnNode

View.centerCameraOnNode(nodeId, duration, camera)
Arguments:
  • nodeId (number()) – None
  • duration (number()) – the number of milliseconds to transition to the new camera.
  • camera (Camera()) – None

Centers the camera on a specified node id.

Return type:Promise <void>

clearLights

View.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:
  • [[InstanceModifier.DoNotLight]]
  • [[setLightingEnabled]]
Return type:void

compositePickFromPoint

View.compositePickFromPoint(point, config)
Arguments:
  • point (Point2()) – Canvas position to pick from.
  • config (PickConfig()) – The configuration object used for this picking operation.

Performs a composite picking operation. This operation will return all candidate Node entities according to the PickConfig.

Returns:An object containing the result of the picking operation.
Return type:Promise <CompositeSelectionItem>

endComparison

View.endComparison()

Disables a visual comparison of two sets of nodes enabled by [[startComparison]].

Return type:void

endIncrementalSelection

View.endIncrementalSelection(handle)
Arguments:
  • handle (IncrementalSelectionId()) – The selection context to destroy.

Deactivates and destroys the provided selection context.

Return type:Promise <void>

fitBounding

View.fitBounding(bounding, duration, camera)
Arguments:
  • bounding (Box()) – bounding box to fit the camera.
  • duration (number()) – Time in milliseconds for the camera transition to the new camera view.
  • camera (Camera()) – None

Fits the camera to the bounding box.

Returns:A promise that will be resolved once the transition is complete.
Return type:Promise <void>

fitNodes

View.fitNodes(ids, duration)
Arguments:
  • ids ([number]()) – None
  • duration (number()) – Time in milliseconds for the camera transition to the new camera view.

Fits the camera to the bounding box containing the node ids.

Returns:A promise that will be resolved once the transition is complete.
Return type:Promise <void>

fitWorld

View.fitWorld(duration[, camera])
Arguments:
  • duration (number()) – the number of milliseconds to transition to the new camera.
  • camera (Camera()) – optional None

Fits the view to the model bounding box.

Returns:A promise that will be resolved once the transition is complete.
Return type:Promise <void>

getAmbientLightColor

View.getAmbientLightColor()

Gets the color of the ambient light applied to the scene.

See also [[setAmbientLightColor]].

Return type:Color

getAmbientOcclusionEnabled

View.getAmbientOcclusionEnabled()
Returns:boolean value indicating whether ambient occlusion is enabled
Return type:boolean

getAmbientOcclusionRadius

View.getAmbientOcclusionRadius()
Returns:the ambient occlusion radius
Return type:number

getAntiAliasingMode

View.getAntiAliasingMode()

Gets the anti-aliasing mode for the scene. The Default value is AntiAliasingMode.SMAA

Returns:the current anti-aliasing mode.
Return type:AntiAliasingMode

getAxisTriad

View.getAxisTriad()
Return type:AxisTriad

getBackfacesVisible

View.getBackfacesVisible()

Gets whether backfaces are being rendered in the scene.

Returns:Boolean value indicating whether backfaces are being rendered in the scene.
Return type:boolean

getBackgroundColor

View.getBackgroundColor()

Returns the background colors of the canvas.

Returns:the canvas background colors.
Return type:VerticalGradient

getBloomEnabled

View.getBloomEnabled()

Returns whether bloom is enabled.

See [[setBloomEnabled]].

Return type:boolean

getBloomIntensityScale

View.getBloomIntensityScale()

Gets the intensity of the bloom effect.

See [[setBloomIntensityScale]].

Return type:number

getBloomLayers

View.getBloomLayers()

Returns an array of objects describing each layer in the bloom effect.

See [[setBloomLayers]].

Return type:[BloomLayerInfo]

getBloomThreshold

View.getBloomThreshold()

Returns the minimum luminance value a pixel must have for it to contribute to bloom.

See [[setBloomThreshold]], [[getBloomThresholdRampWidth]].

Return type:number

getBloomThresholdRampWidth

View.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.

See [[setBloomThresholdRampWidth]].

Return type:number

getBoundingCalculationIgnoresInvisible

View.getBoundingCalculationIgnoresInvisible()
Returns:whether or not bounding calculations by this View object ignores invisible geometry.
Return type:boolean

getCamera

View.getCamera()

Gets the current camera

Returns:the current camera
Return type:Camera

getCanvasSize

View.getCanvasSize()

Returns the size of the viewer canvas.

Returns:the current size of the viewer canvas.
Return type:Point2

getDrawMode

View.getDrawMode()
Returns:The current draw mode
Return type:DrawMode

getDrawStrategy

View.getDrawStrategy()

Gets the draw strategy.

Returns:The current draw strategy.
Return type:DrawStrategy

getEyeDomeLightingBlurEdgeDistance

View.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.

Return type:Promise <number>

getEyeDomeLightingBlurInterval

View.getEyeDomeLightingBlurInterval()

Returns the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds.

Return type:Promise <number>

getEyeDomeLightingBlurSamples

View.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.

Return type:Promise <number>

getEyeDomeLightingEnabled

View.getEyeDomeLightingEnabled()
Returns:boolean value indicating if eye-dome lighting is enabled or disabled.
Return type:Promise <boolean>

getEyeDomeLightingOpacity

View.getEyeDomeLightingOpacity()

Returns the opacity of the shading rendered by eye-dome lighting for point clouds. The value is in the range [0,1].

Return type:Promise <number>

getEyeDomeLightingShadingEdgeDistance

View.getEyeDomeLightingShadingEdgeDistance()

Returns a value that controls the shading contrast in eye-dome lighting for point clouds. The value is a number of pixels.

Return type:Promise <number>

getFaceVisibility

View.getFaceVisibility()

Gets the face visibility for the view.

Returns:whether faces are currently being drawn.
Return type:boolean

getFullCameraMatrix

View.getFullCameraMatrix()

This is equivalent to (projectionMatrix * viewMatrix).

Returns:The current full camera matrix.
Return type:Matrix

getGoochBaseColorProminence

View.getGoochBaseColorProminence()

Gets the prominence of the object’s base color in Gooch shading.

Return type:number

getGoochBlue

View.getGoochBlue()

Gets the value to use as the blue tone in Gooch shading.

Return type:number

getGoochLuminanceShiftStrength

View.getGoochLuminanceShiftStrength()

Gets the strength of the luminance shift in Gooch shading.

Return type:number

getGoochYellow

View.getGoochYellow()

Gets the value to use as the yellow tone in Gooch shading.

Return type:number

getGroundPlane

View.getGroundPlane()

Returns information about the invisible ground plane onto which simple shadows and reflections are projected.

See also:
  • [[setGroundPlane]]
Return type:GroundPlane

getHardEdgeColor

View.getHardEdgeColor()

Returns the color of hard edges.

See also: - [[setHardEdgeColor]] - [[setHardEdgesEnabled]]

Return type:Color

getHardEdgeOpacity

View.getHardEdgeOpacity()

Returns the opacity of hard edges.

See also: - [[setHardEdgeOpacity]] - [[setHardEdgesEnabled]]

Return type:number

getHardEdgesEnabled

View.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]].

Return type:boolean

getHardEdgeThreshold

View.getHardEdgeThreshold()

Returns the angle threshold for hard edges. Edges will be drawn between two faces whose normals diverge beyond this angle.

See also: - [[setHardEdgeThreshold]] - [[setHardEdgeThresholdRampWidth]] - [[setHardEdgesEnabled]]

Return type:number

getHardEdgeThresholdRampWidth

View.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: - [[setHardEdgeThresholdRampWidth]] - [[setHardEdgesEnabled]]

Return type:number

getHiddenLineSettings

View.getHiddenLineSettings()
Returns:a [[HiddenLineSettings]] object.
Return type:HiddenLineSettings

getImageBasedLightingEnabled

View.getImageBasedLightingEnabled()

Returns whether image-based lighting is enabled for physically-based materials.

See also: - [[setImageBasedLightingEnabled]] - [[setImageBasedLightingIntensity]] - [[setImageBasedLightingOrientation]]

Return type:boolean

getImageBasedLightingIntensity

View.getImageBasedLightingIntensity()

Returns the intensity (brightness) of image-based lighting applied to physically-based materials.

The default value is 1.

See also: - [[setImageBasedLightingIntensity]] - [[setImageBasedLightingEnabled]] - [[setImageBasedLightingOrientation]]

Return type:number

getImageBasedLightingOrientation

View.getImageBasedLightingOrientation()

Returns the orientation of the image-based lighting environment applied to physically-based materials.

See also: - [[setImageBasedLightingOrientation]] - [[setImageBasedLightingEnabled]] - [[setImageBasedLightingIntensity]]

Return type:ImageBasedLightingOrientation

getInteractiveDrawLimitIncreaseEnabled

View.getInteractiveDrawLimitIncreaseEnabled()

Gets whether or not the viewer will periodically attempt to increase the amount drawn during interaction.

Returns:boolean value indicating whether this feature is enabled or not
Return type:Promise <boolean>

getLight

View.getLight(key)
Arguments:
  • key (LightKey()) – The key of the light to get.

Get a Light given its key if it exists.

Returns:A Light given its key if it exists.
Return type:Promise <undefined | Light>

getLightingEnabled

View.getLightingEnabled()

Returns whether lighting is enabled.

See also [[setLightingEnabled]].

Return type:boolean

getLightKeys

View.getLightKeys()

Get the list of light keys in the scene.

Returns:The list of light keys in the scene.
Return type:Promise <[LightKey]>

getLineJitterEnabled

View.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: - [[setLineJitterEnabled]] - [[getLineJitterInstanceCount]] - [[getLineJitterRadius]] - [[getLineJitterFrequency]]

Return type:boolean

getLineJitterFrequency

View.getLineJitterFrequency()

Returns the frequency of the noise used to offset line vertices when line jitter is enabled. The default value is 5.

See also: - [[getLineJitterEnabled]] - [[getLineJitterInstanceCount]] - [[getLineJitterRadius]] - [[setLineJitterFrequency]]

Return type:number

getLineJitterInstanceCount

View.getLineJitterInstanceCount()

Returns the number of times lines are drawn when line jitter is enabled. The default value is 4.

See also: - [[getLineJitterEnabled]] - [[setLineJitterInstanceCount]] - [[getLineJitterRadius]] - [[getLineJitterFrequency]]

Return type:number

getLineJitterRadius

View.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: - [[getLineJitterEnabled]] - [[getLineJitterInstanceCount]] - [[setLineJitterRadius]] - [[getLineJitterFrequency]]

Return type:number

getLineVisibility

View.getLineVisibility()

Gets the line visibility for the view.

Returns:whether lines are currently being drawn.
Return type:boolean

getMassageExtremeCameras

View.getMassageExtremeCameras()
Return type:boolean

getNavCube

View.getNavCube()
Return type:NavCube

getPointShape

View.getPointShape()

Gets the PointShape. See [[PointShape]]

Return type:Promise <PointShape>

getPointSize

View.getPointSize()

Gets the diameter of rendered points. See [[PointSizeUnit]].

Return type:Promise <(number, PointSizeUnit)>

getProjectionMatrix

View.getProjectionMatrix()

Gets the projection matrix.

Returns:The current projection matrix.
Return type:Matrix

getProjectionMode

View.getProjectionMode()

Gets the projection mode.

Returns:The current projection mode.
Return type:Projection

getSilhouetteColor

View.getSilhouetteColor()

Returns the color of silhouette edges.

See also: - [[setSilhouetteColor]] - [[setSilhouetteEnabled]]

Return type:Color

getSilhouetteEnabled

View.getSilhouetteEnabled()

Returns whether silhouette edges are enabled.

Silhouette edges are always enabled in hidden line mode, regardless of the return value.

See [[setSilhouetteEnabled]].

Return type:boolean

getSilhouetteOpacity

View.getSilhouetteOpacity()

Returns the opacity of silhouette edges.

See also: - [[setSilhouetteOpacity]] - [[setSilhouetteEnabled]]

Return type:number

getSilhouetteThreshold

View.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: - [[setSilhouetteThreshold]] - [[setSilhouetteThresholdRampWidth]] - [[setSilhouetteEnabled]]

Return type:number

getSilhouetteThresholdRampWidth

View.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: - [[setSilhouetteThresholdRampWidth]] - [[setSilhouetteEnabled]]

Return type:number

getSimpleReflectionAttenuation

View.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 beyond farDistance.

Attenuation is disabled if farDistance is less than or equal to nearDistance.

See also:
  • [[setSimpleReflectionAttenuation]]
  • [[setSimpleReflectionEnabled]]
Returns:An object with the following properties:
Return type:function

getSimpleReflectionBlurInterval

View.getSimpleReflectionBlurInterval()

Returns the distance between samples taken by the blur filter used for simple reflections.

See also:
  • [[setSimpleReflectionBlurInterval]]
  • [[setSimpleReflectionEnabled]]
Return type:(number, BlurIntervalUnit)

getSimpleReflectionBlurSamples

View.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: - [[setSimpleReflectionBlurSamples]] - [[setSimpleReflectionEnabled]]

Return type:number

getSimpleReflectionEnabled

View.getSimpleReflectionEnabled()

Returns whether simple reflections are enabled.

See [[setSimpleReflectionEnabled]].

Return type:boolean

getSimpleReflectionFadeAngle

View.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: - [[setSimpleReflectionFadeAngle]] - [[setSimpleReflectionEnabled]]

Return type:number

getSimpleReflectionOpacity

View.getSimpleReflectionOpacity()

Returns the opacity of simple reflections.

See also:
  • [[setSimpleReflectionOpacity]]
  • [[setSimpleReflectionEnabled]]
Return type:number

getSimpleShadowBlurInterval

View.getSimpleShadowBlurInterval()

Returns the distance in pixels between samples taken by the blur filter used for simple shadows.

See also:
  • [[setSimpleShadowBlurInterval]]
  • [[setSimpleShadowEnabled]]
Return type:number

getSimpleShadowBlurSamples

View.getSimpleShadowBlurSamples()

Returns the diameter of the blur filter used for simple shadows.

See also:
  • [[setSimpleShadowBlurSamples]]
  • [[setSimpleShadowEnabled]]
Return type:number

getSimpleShadowColor

View.getSimpleShadowColor()

Returns the color of simple shadows.

See also:
  • [[setSimpleShadowColor]]
  • [[setSimpleShadowEnabled]]
Return type:Color

getSimpleShadowEnabled

View.getSimpleShadowEnabled()

Returns whether simple shadows are enabled.

See [[setSimpleShadowEnabled]].

Return type:boolean

getSimpleShadowInteractiveUpdateEnabled

View.getSimpleShadowInteractiveUpdateEnabled()

Returns whether simple shadows will be updated during user interaction.

See also:
  • [[setSimpleShadowInteractiveUpdateEnabled]]
  • [[setSimpleShadowEnabled]]
Return type:boolean

getSimpleShadowOpacity

View.getSimpleShadowOpacity()

Returns the opacity of simple shadows.

See also:
  • [[setSimpleShadowOpacity]]
  • [[setSimpleShadowEnabled]]
Return type:number

getSimpleShadowResolution

View.getSimpleShadowResolution()

Returns the width and height in pixels of the texture image into which simple shadows are drawn.

See also:
  • [[getSimpleShadowResolution]]
  • [[setSimpleShadowEnabled]]
Return type:number

getToonShadingBandCount

View.getToonShadingBandCount()

Gets the current number of discrete shading bands that will be used when toon shading is enabled.

Return type:number

getToonShadingSpecularFactor

View.getToonShadingSpecularFactor()

Gets the current toon shading specular scale factor.

Return type:number

getViewMatrix

View.getViewMatrix()

Gets the view matrix.

Returns:The current view matrix.
Return type:Matrix

getViewOrientationCamera

View.getViewOrientationCamera(orientation[, bounding, preserveModelUp])
Arguments:
  • orientation (ViewOrientation()) – The desired view orientation for the camera.
  • bounding (Box()) – optional Optional bounding to fit the camera about. If not supplied, the model bounding will be used.
  • preserveModelUp (boolean()) – None

Returns a camera set to a ViewOrientation

Return type:Promise <Camera>

injectViewOrientationChangeEvent

View.injectViewOrientationChangeEvent()

hidden

Return type:void

isolateNodes

View.isolateNodes(nodeIds, duration, fitNodes, initiallyHiddenStayHidden)
Arguments:
  • nodeIds ([number]()) – An array of the node IDs to be isolated.
  • duration (number()) – Time in milliseconds for the camera transition to the new camera view.
  • fitNodes (boolean()) – If true, then the view is fitted around the isolated nodes.
  • initiallyHiddenStayHidden (null | boolean()) – Controls whether or not initially hidden geometries stay hidden. Default behavior is driven by [[setBehaviorInitiallyHidden]].

Hides all nodes except those specified. Also fits the camera to those nodes’ bounding box.

Return type:Promise <void>

pickAllFromPoint

View.pickAllFromPoint(point, config)
Arguments:
  • point (Point2()) – Canvas position to pick from.
  • config (PickConfig()) – The configuration object used for this picking operation.

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.

Returns:An object containing the result of the picking operation.
Return type:Promise <[NodeEntitySelectionItem]>

pickAllFromRay

View.pickAllFromRay(ray, config)
Arguments:
  • ray (Ray()) – The world-space ray to perform the selection with.
  • config (PickConfig()) – The configuration object used for this picking operation.

Performs a selection operation from the given world-space ray. All candidate entities are returned. This method does not trigger a selection event.

Returns:An object containing the result of the picking operation.
Return type:Promise <[NodeEntitySelectionItem]>

pickFromPoint

View.pickFromPoint(point, config)
Arguments:
  • point (Point2()) – Canvas position to pick from.
  • config (PickConfig()) – The configuration object used for this picking operation.

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.

Returns:An object containing the result of the picking operation.
Return type:Promise <SelectionItem>

pickFromRay

View.pickFromRay(ray, config)
Arguments:
  • ray (Ray()) – The world-space ray to perform the selection with.
  • config (PickConfig()) – The configuration object used for this picking operation.

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.

Returns:An object containing the result of the picking operation.
Return type:Promise <SelectionItem>

pointToWindowPosition

View.pointToWindowPosition(pt)
Arguments:

Creates a normalized window position in the range of (-1, 1) for a given point in window space.

Returns:the normalized window position
Return type:Point2

projectPoint

View.projectPoint(source[, camera])
Arguments:
  • source (Point3()) – None
  • camera (Camera()) – optional if a camera is provided, its projection and view matrix will be used.

Projects a 3d world space point to a 3d screen space point.

Returns:point projected into 3d screen space.
Return type:Point3

raycastFromPoint

View.raycastFromPoint(point)
Arguments:
  • point (Point2()) – The (X, Y) viewport position.

Creates a ray based on a viewport position.

Returns:The ray if it was generated, otherwise null.
Return type:null | Ray

redraw

View.redraw([callback])
Arguments:
  • callback (function()) – optional A function to be called once the draw is complete. This is provided instead of a Promise to ensure the callback is called before the start of another redraw.

Forces the a redraw of this view.

Return type:void
View.callback()
Return type:void

removeLight

View.removeLight(key)
Arguments:
  • key (LightKey()) – None

removes a light from the scene. See [[Light]].

See also:
  • [[addLight]]
  • [[clearLights]]
  • [[updateLight]]
Return type:void

resetCamera

View.resetCamera(duration)
Arguments:
  • duration (number()) – the amount of time in milliseconds that the camera transition between the current and initial view should take.

Resets the camera to the initial view of the model when first loaded.

Return type:Promise <void>

setAmbientLightColor

View.setAmbientLightColor(value)
Arguments:

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]].

Return type:void

setAmbientOcclusionEnabled

View.setAmbientOcclusionEnabled(enabled)
Arguments:
  • enabled (boolean()) – sets whether ambient occlusion will be enabled

Sets whether ambient occlusion is enabled

Return type:Promise <void>

setAmbientOcclusionRadius

View.setAmbientOcclusionRadius(radius)
Arguments:
  • radius (number()) – the ambient occlusion radius.

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.

Return type:Promise <void>

setAntiAliasingMode

View.setAntiAliasingMode(antiAliasingMode)
Arguments:
  • antiAliasingMode (AntiAliasingMode()) – None

Sets the anti-aliasing mode for the scene.

Return type:Promise <void>

setBackfacesVisible

View.setBackfacesVisible(visible)
Arguments:
  • visible (boolean()) – Boolean value indicating whether backfaces should be rendered.

Sets whether backfaces should be rendered in the scene.

Returns:Promise that is resolved when this operation has completed.
Return type:Promise <void>

setBackgroundColor

View.setBackgroundColor(top, bottom)
Arguments:
  • top (null | Color()) – the top color for the the background gradient.
  • bottom (null | Color()) – the bottom color for the the background gradient.

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.

When draw mode is set to DrawMode.HiddenLine, the background color is defined in HiddenLineSettings HiddenLineSettings. See HiddenLineSettings.setBackgroundColor HiddenLineSettings.setBackgroundColor.

Returns:a promise that resolves when the operation has completed.
Return type:Promise <void>

setBloomEnabled

View.setBloomEnabled(value)
Arguments:
  • value (boolean()) – None

Sets whether bloom is enabled.

See [[getBloomEnabled]].

Return type:void

setBloomIntensityScale

View.setBloomIntensityScale(value)
Arguments:
  • value (number()) – None

Sets the intensity of the bloom effect. This value is multiplied by the intensities of the individual layers set by [[setBloomLayers]].

See [[getBloomIntensityScale]].

Return type:void

setBloomLayers

View.setBloomLayers(layers)
Arguments:
  • layers ([BloomLayerInfo]()) – None

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]].

Return type:void

setBloomThreshold

View.setBloomThreshold(value)
Arguments:
  • value (number()) – None

Sets the minimum luminance value a pixel must have for it to contribute to bloom. The value should be in the range [0,1].

See [[getBloomThreshold]], [[setBloomThresholdRampWidth]].

Return type:void

setBloomThresholdRampWidth

View.setBloomThresholdRampWidth(value)
Arguments:
  • value (number()) – None

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.

See [[getBloomThresholdRampWidth]].

Return type:void

setBoundingCalculationIgnoresInvisible

View.setBoundingCalculationIgnoresInvisible(value)
Arguments:
  • value (boolean()) – None

Sets whether or not bounding calculations by this View object ignores invisible geometry.

Return type:void

setCamera

View.setCamera(camera, duration)
Arguments:
  • camera (null | Camera()) – the camera to set
  • duration (number()) – camera transition time in milliseconds

Sets the current camera

Return type:boolean

setDisplayIncompleteFrames

View.setDisplayIncompleteFrames(value)
Arguments:
  • value (boolean()) – None

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.

Return type:Promise <void>

setDrawMode

View.setDrawMode(drawMode)
Arguments:
  • drawMode (DrawMode()) – The drawing mode to set.

Sets the drawing mode for the scene.

Return type:Promise <void>

setEyeDomeLightingBlurEdgeDistance

View.setEyeDomeLightingBlurEdgeDistance(value)
Arguments:
  • value (number()) – None

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)

Return type:Promise <void>

setEyeDomeLightingBlurInterval

View.setEyeDomeLightingBlurInterval(value)
Arguments:
  • value (number()) – None

Sets the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds. (default: 1)

Return type:Promise <void>

setEyeDomeLightingBlurSamples

View.setEyeDomeLightingBlurSamples(value)
Arguments:
  • value (number()) – None

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)

Return type:Promise <void>

setEyeDomeLightingEnabled

View.setEyeDomeLightingEnabled(enabled)
Arguments:
  • enabled (boolean()) – None

Enables or disables eye-dome lighting for point clouds. (default: disabled)

Return type:Promise <void>

setEyeDomeLightingOpacity

View.setEyeDomeLightingOpacity(value)
Arguments:
  • value (number()) – A number in the range [0,1].

Sets the opacity of the shading rendered by eye-dome lighting for point clouds. (default: 1)

Return type:Promise <void>

setEyeDomeLightingShadingEdgeDistance

View.setEyeDomeLightingShadingEdgeDistance(value)
Arguments:
  • value (number()) – None

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)

Return type:Promise <void>

setFaceVisibility

View.setFaceVisibility(faceVisibility)
Arguments:
  • faceVisibility (boolean()) – indicates whether to draw faces.

Sets the face visibility for the view.

Return type:Promise <void>

setGoochBaseColorProminence

View.setGoochBaseColorProminence(prominence)
Arguments:
  • prominence (number()) – this scalar value determines the amount of the object’s base color is applied to the final shaded color.

Sets the prominence of the object’s base color in Gooch shading.

Return type:void

setGoochBlue

View.setGoochBlue(blue)
Arguments:
  • blue (number()) – the blue tone. This value should be in the range [0,1]

Sets the value to use as the blue tone in Gooch shading.

Return type:void

setGoochLuminanceShiftStrength

View.setGoochLuminanceShiftStrength(shiftStrength)
Arguments:
  • shiftStrength (number()) – this scalar values determines the amount of luminance shift that is applied to the object’s base color

Sets the strength of the luminance shift in Gooch shading.

Return type:void

setGoochYellow

View.setGoochYellow(yellow)
Arguments:
  • yellow (number()) – the yellow tone. This value should be in the range [0,1]

Sets the value to use as the yellow tone in Gooch shading.

Return type:void

setGroundPlane

View.setGroundPlane(plane)
Arguments:

Defines the invisible ground plane onto which simple shadows and reflections are projected.

See also:
  • [[getGroundPlane]]
  • [[setSimpleShadowEnabled]]
  • [[setSimpleReflectionEnabled]]
Return type:void

setHardEdgeColor

View.setHardEdgeColor(value)
Arguments:
  • value (Color()) – The color to set.

Sets the color of hard edges.

See also: - [[getHardEdgeColor]] - [[setHardEdgesEnabled]]

Return type:void

setHardEdgeOpacity

View.setHardEdgeOpacity(value)
Arguments:
  • value (number()) – The opacity to set.

Sets the opacity of hard edges.

See also: - [[getHardEdgeOpacity]] - [[setHardEdgesEnabled]]

Return type:void

setHardEdgesEnabled

View.setHardEdgesEnabled(value)
Arguments:
  • value (boolean()) – Whether hard edges should be enabled.

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: - [[getHardEdgesEnabled]] - [[setHardEdgeColor]] - [[setHardEdgeOpacity]] - [[setHardEdgeThreshold]] - [[setHardEdgeThresholdRampWidth]]

Return type:void

setHardEdgeThreshold

View.setHardEdgeThreshold(degrees)
Arguments:
  • degrees (number()) – The threshold to set.

Sets the angle threshold for hard edges. Edges will be drawn between two faces whose normals diverge beyond this angle.

See also: - [[getHardEdgeThreshold]] - [[setHardEdgeThresholdRampWidth]] - [[setHardEdgesEnabled]]

Return type:void

setHardEdgeThresholdRampWidth

View.setHardEdgeThresholdRampWidth(degrees)
Arguments:
  • degrees (number()) – None

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: - [[getHardEdgeThresholdRampWidth]] - [[setHardEdgesEnabled]]

Return type:void

setImageBasedLightingEnabled

View.setImageBasedLightingEnabled(value)
Arguments:
  • value (boolean()) – None

Sets whether image-based lighting is enabled for physically-based materials.

See also: - [[getImageBasedLightingEnabled]] - [[setImageBasedLightingIntensity]] - [[setImageBasedLightingOrientation]]

Return type:void

setImageBasedLightingEnvironment

View.setImageBasedLightingEnvironment(data)
Arguments:
  • data (null | Uint8Array()) – None

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](https://hdrihaven.com)) with the following process:

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
Return type:void

setImageBasedLightingIntensity

View.setImageBasedLightingIntensity(value)
Arguments:
  • value (number()) – None

Sets the intensity (brightness) of image-based lighting applied to physically-based materials.

The default value is 1.

See also: - [[getImageBasedLightingIntensity]] - [[setImageBasedLightingEnabled]] - [[setImageBasedLightingOrientation]]

Return type:void

setImageBasedLightingOrientation

View.setImageBasedLightingOrientation(value)
Arguments:

Sets the orientation of the image-based lighting environment applied to physically-based materials.

See also: - [[getImageBasedLightingOrientation]] - [[setImageBasedLightingEnabled]] - [[setImageBasedLightingIntensity]]

Return type:void

setInitialCamera

View.setInitialCamera(camera)
Arguments:

Sets the camera that will be used for the initial camera view.

Return type:void

setInteractiveDrawDelay

View.setInteractiveDrawDelay(value)
Arguments:
  • value (number()) – The delay in milliseconds

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.

Return type:Promise <void>

setInteractiveDrawLimitIncreaseEnabled

View.setInteractiveDrawLimitIncreaseEnabled(enable)
Arguments:
  • enable (boolean()) – None

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.

Return type:void

setLightingEnabled

View.setLightingEnabled(enabled)
Arguments:
  • enabled (boolean()) – None

Sets whether lighting is enabled. When disabled, material colors are drawn at full intensity.

See also [[InstanceModifier.DoNotLight]], [[clearLights]].

Return type:Promise <void>

setLineJitterEnabled

View.setLineJitterEnabled(value)
Arguments:
  • value (boolean()) – None

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: - [[getLineJitterEnabled]] - [[setLineJitterInstanceCount]] - [[setLineJitterRadius]] - [[setLineJitterFrequency]]

Return type:void

setLineJitterFrequency

View.setLineJitterFrequency(value)
Arguments:
  • value (number()) – None

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: - [[setLineJitterEnabled]] - [[setLineJitterInstanceCount]] - [[setLineJitterRadius]] - [[getLineJitterFrequency]]

Return type:void

setLineJitterInstanceCount

View.setLineJitterInstanceCount(value)
Arguments:
  • value (number()) – None

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: - [[setLineJitterEnabled]] - [[getLineJitterInstanceCount]] - [[setLineJitterRadius]] - [[setLineJitterFrequency]]

Return type:void

setLineJitterRadius

View.setLineJitterRadius(value)
Arguments:
  • value (number()) – None

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: - [[setLineJitterEnabled]] - [[setLineJitterInstanceCount]] - [[getLineJitterRadius]] - [[setLineJitterFrequency]]

Return type:void

setLineVisibility

View.setLineVisibility(lineVisibility)
Arguments:
  • lineVisibility (boolean()) – indicates whether to draw lines.

Sets the line visibility for the view.

Return type:Promise <void>

setMassageExtremeCameras

View.setMassageExtremeCameras(value)
Arguments:
  • value (boolean()) – Whether to modify cameras

Sets whether to change cad view cameras with extreme values to functionally identical cameras with better behavior. This should be disabled if it is important that cameras have their authored values Default: true

Return type:void

setMinimumFramerate

View.setMinimumFramerate(minimum)
Arguments:
  • minimum (number()) – The minimum framerate to be maintained by this view.

Sets a minimum frame rate that will be maintained by this views. The view will use various culling techniques in order to maintain the value passed in.

Passing 0 will cause the entire scene to be drawn for every frame.

Return type:void

setPointShape

View.setPointShape(shape)
Arguments:
  • shape (PointShape()) – None

Controls the appearance of rendered points. (default: Square) See [[PointShape]].

Return type:Promise <void>

setPointSize

View.setPointSize(size, unit)
Arguments:
  • size (number()) – None
  • unit (PointSizeUnit()) – None

Sets the diameter of rendered points. (default: 1, ScreenPixels) See [[PointSizeUnit]].

Return type:Promise <void>

setPointVisibilityTest

View.setPointVisibilityTest(points)
Arguments:
  • points ([Point3]()) – The points to test. An empty array will disable the test.

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]].

Return type:void

setProjectionMode

View.setProjectionMode(projectionMode)
Arguments:
  • projectionMode (Projection()) – None

Sets the projection mode.

Return type:void

setSilhouetteColor

View.setSilhouetteColor(value)
Arguments:
  • value (Color()) – The color to set.

Sets the color of silhouette edges.

See also: - [[getSilhouetteColor]] - [[setSilhouetteEnabled]]

Return type:void

setSilhouetteEnabled

View.setSilhouetteEnabled(value)
Arguments:
  • value (boolean()) – Whether silhouette edges should be enabled.

Enables or disables silhouette edges.

Silhouette edges are always enabled in hidden line mode.

See also: - [[getSilhouetteEnabled]] - [[setSilhouetteColor]] - [[setSilhouetteOpacity]] - [[setSilhouetteThreshold]] - [[setSilhouetteThresholdRampWidth]]

Return type:void

setSilhouetteOpacity

View.setSilhouetteOpacity(value)
Arguments:
  • value (number()) – The opacity to set.

Sets the opacity of silhouette edges.

See also: - [[getSilhouetteOpacity]] - [[setSilhouetteEnabled]]

Return type:void

setSilhouetteThreshold

View.setSilhouetteThreshold(value)
Arguments:
  • value (number()) – The threshold to set.

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: - [[getSilhouetteThreshold]] - [[setSilhouetteThresholdRampWidth]] - [[setSilhouetteEnabled]]

Return type:void

setSilhouetteThresholdRampWidth

View.setSilhouetteThresholdRampWidth(value)
Arguments:
  • value (number()) – None

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: - [[getSilhouetteThresholdRampWidth]] - [[setSilhouetteEnabled]]

Return type:void

setSimpleReflectionAttenuation

View.setSimpleReflectionAttenuation(nearDistance, farDistance, unit)
Arguments:
  • 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.
  • unit (SimpleReflectionAttenuationUnit()) – The unit in which nearDistance and farDistance are specified. If unspecified, [[SimpleReflectionAttenuationUnit.World]] will be used.

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 beyond farDistance.

Attenuation is disabled if farDistance is less than or equal to nearDistance.

See also:
  • [[getSimpleReflectionAttenuation]]
  • [[setSimpleReflectionEnabled]]
Return type:void

setSimpleReflectionBlurInterval

View.setSimpleReflectionBlurInterval(value, unit)
Arguments:
  • value (number()) – The interval to set.
  • unit (BlurIntervalUnit()) – The unit in which the value argument is specified.

Sets the distance between samples taken by the blur filter used for simple reflections.

See also:
  • [[getSimpleReflectionBlurInterval]]
  • [[setSimpleReflectionEnabled]]
Return type:void

setSimpleReflectionBlurSamples

View.setSimpleReflectionBlurSamples(value)
Arguments:
  • value (number()) – None

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: - [[getSimpleReflectionBlurSamples]] - [[setSimpleReflectionEnabled]]

Return type:void

setSimpleReflectionEnabled

View.setSimpleReflectionEnabled(value)
Arguments:
  • value (boolean()) – None

Enables or disables simple reflections projected onto an invisible ground plane.

See also: - [[getSimpleReflectionEnabled]] - [[setSimpleReflectionOpacity]] - [[setSimpleReflectionBlurSamples]] - [[setSimpleReflectionBlurInterval]] - [[setSimpleReflectionFadeAngle]]

Return type:void

setSimpleReflectionFadeAngle

View.setSimpleReflectionFadeAngle(degrees)
Arguments:
  • degrees (number()) – The angle in degrees.

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: - [[getSimpleReflectionFadeAngle]] - [[setSimpleReflectionEnabled]]

Return type:void

setSimpleReflectionOpacity

View.setSimpleReflectionOpacity(value)
Arguments:
  • value (number()) – None

Sets the opacity of simple reflections.

See also:
  • [[getSimpleReflectionOpacity]]
  • [[setSimpleReflectionEnabled]]
Return type:void

setSimpleShadowBlurInterval

View.setSimpleShadowBlurInterval(value)
Arguments:
  • value (number()) – The interval to set.

Sets the distance in pixels between samples taken by the blur filter used for simple shadows.

See also:
  • [[getSimpleShadowBlurInterval]]
  • [[setSimpleShadowEnabled]]
Return type:void

setSimpleShadowBlurSamples

View.setSimpleShadowBlurSamples(value)
Arguments:
  • value (number()) – The number of samples.

Sets the diameter of the blur filter used for simple shadows. Setting the value to 0 will disable blurring.

See also:
  • [[getSimpleShadowBlurSamples]]
  • [[setSimpleShadowEnabled]]
Return type:void

setSimpleShadowColor

View.setSimpleShadowColor(color)
Arguments:
  • color (Color()) – The color to set.

Sets the color of simple shadows.

See also:
  • [[getSimpleShadowColor]]
  • [[setSimpleShadowEnabled]]
Return type:void

setSimpleShadowEnabled

View.setSimpleShadowEnabled(value)
Arguments:
  • value (boolean()) – Whether simple shadows should be enabled.

Enables or disables a full-scene shadow projected onto an invisible ground plane.

See also:
  • [[getSimpleShadowEnabled]]
  • [[setSimpleShadowColor]]
  • [[setSimpleShadowOpacity]]
  • [[setGroundPlane]]
  • [[setSimpleShadowResolution]]
  • [[setSimpleShadowInteractiveUpdateEnabled]]
Return type:void

setSimpleShadowInteractiveUpdateEnabled

View.setSimpleShadowInteractiveUpdateEnabled(value)
Arguments:
  • value (boolean()) – None

Enables or disables updates to simple shadows during user interaction.

See also:
  • [[getSimpleShadowInteractiveUpdateEnabled]]
  • [[setSimpleShadowEnabled]]
Return type:void

setSimpleShadowOpacity

View.setSimpleShadowOpacity(opacity)
Arguments:
  • opacity (number()) – The opacity to set.

Sets the opacity of simple shadows.

See also:
  • [[getSimpleShadowOpacity]]
  • [[setSimpleShadowEnabled]]
Return type:void

setSimpleShadowResolution

View.setSimpleShadowResolution(pixels)
Arguments:
  • pixels (number()) – The resolution to set.

Sets the width and height in pixels of the texture image into which simple shadows are drawn.

See also:
  • [[getSimpleShadowResolution]]
  • [[setSimpleShadowEnabled]]
Return type:void

setStatisticsDisplayVisibility

View.setStatisticsDisplayVisibility(visibility)
Arguments:
  • visibility (boolean()) – None

Sets the display for the default statistic overlay.

Return type:Promise <void>

setToonShadingBandCount

View.setToonShadingBandCount(bandCount)
Arguments:
  • bandCount (number()) – None

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.

Return type:void

setToonShadingSpecularFactor

View.setToonShadingSpecularFactor(specularFactor)
Arguments:
  • specularFactor (number()) – None

Sets a scale factor which controls the size of specular highlights when toon shading is enabled. The default value is 1.0.

Return type:void

setTransparencyMode

View.setTransparencyMode(mode)
Arguments:
  • mode (TransparencyMode()) – None

Sets how transparent objects are blended.

Return type:void

setViewOrientation

View.setViewOrientation(orientation, duration[, bounding, preserveModelUp])
Arguments:
  • orientation (ViewOrientation()) – The desired view orientation for the camera.
  • duration (number()) – The number of milliseconds used to transition to the new camera.
  • bounding (Box()) – optional Optional bounding to fit the camera about. If not supplied, the model bounding will be used.
  • preserveModelUp (boolean()) – Indicates whether the camera up will be set according to model up or current camera.

Sets the view to a standard orientation.

Return type:Promise <void>

setXRayColor

View.setXRayColor(element, color, group)
Arguments:
  • element (ElementType()) – the type of geometry to apply the color to
  • color (Color()) – the color to apply
  • group (XRayGroup()) – the category of nodes that will be affected. If unspecified, [[XRayGroup.Selected]] will be used.

Sets the color applied to nodes in x-ray mode. By default, the color is unset.

See [[unsetXRayColor]].

Return type:Promise <void>

setXRayOpacity

View.setXRayOpacity(opacity[, element])
Arguments:
  • opacity (number()) – a number between 0 and 1
  • element (ElementType()) – optional the type of element to which the opacity will apply. If unspecified, the opacity will apply to all element types.

Sets the opacity of unselected items in x-ray mode.

Return type:Promise <void>

setXRayTransparencyMode

View.setXRayTransparencyMode(mode)
Arguments:
  • mode (TransparencyMode()) – None

Sets how transparent (unselected) objects are blended in x-ray mode.

Return type:Promise <void>

startComparison

View.startComparison(nodeIdSet1, nodeIdSet2[, config])
Arguments:
  • nodeIdSet1 ([number]()) – the nodes to compare against nodeIdSet2
  • nodeIdSet2 ([number]()) – the nodes to compare against nodeIdSet1
  • config (ComparisonConfig()) – optional settings controlling the behavior of the comparison

Enables a visual comparison of two sets of nodes. The nodes specified by nodeIdSet1 are filled with one color, the nodes specified by nodeIdSet2 with another color, and overlapping areas are filled with a third color.

See [[endComparison]].

Return type:void

testPointVisibility

View.testPointVisibility(points)
Arguments:
  • points ([Point3]()) – The points to test.

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.

Returns:A list of indices of the visible points.
Return type:Promise <[number]>

unprojectPoint

View.unprojectPoint(point, z)
Arguments:
  • point (Point2()) – 2d screen space
  • z (number()) – z value, default 0

Unprojects a 2d screen space point to a 3d world space point.

Returns:point world space point
Return type:null | Point3

unsetDefaultCamera

View.unsetDefaultCamera()

Unsets the default camera. After this is called the next camera to be set will be the new default

Return type:void

unsetXRayColor

View.unsetXRayColor(element, group)
Arguments:
  • element (ElementType()) – the type of geometry affected by the change
  • group (XRayGroup()) – the category of nodes that will be affected. If unspecified, [[XRayGroup.Selected]] will be used.

Unsets the color applied to selected items in x-ray mode. Selected items will be displayed without overriding their colors.

See [[setXRayColor]].

Return type:Promise <void>

updateCamera

View.updateCamera(camera)
Arguments:
  • camera (Camera()) – the camera to set.

Updates camera properties individually. This method should be used to incrementally update camera properties individually.

Returns:updated camera object.
Return type:Camera

updateLight

View.updateLight(key, light)
Arguments:
  • key (LightKey()) – None
  • light (Light()) – None

Updates a light in the scene. See [[Light]].

See also:
  • [[addLight]]
  • [[clearLights]]
  • [[removeLight]]
Return type:void