View
- class Communicator.View()
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.
Methods
Properties
- View.axisTriad
- Type
- Type
Methods
addLight
- View.addLight(light)
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
See also: -
clearLights
-removeLight
-updateLight
-setAmbientLightColor
advanceIncrementalSelection
- View.advanceIncrementalSelection(handle)
Returns the next batch of geometry selected by the supplied selection context.
- Arguments
handle (
IncrementalSelectionId()
) – The handle to an active area selection context.
- Return type
Promise <[
NodeSelectionItem()
] | null>- Returns
Returns selected items. If the resulting list is null then there are no more items to select.
advanceVolumeSelection
- View.advanceVolumeSelection(handle)
- Deprecated
Use
advanceIncrementalSelection
instead.- Arguments
handle (
IncrementalSelectionId()
) –
- Return type
Promise <[
NodeSelectionItem()
] | null>
beginConvexPolyhedronSelection
- View.beginConvexPolyhedronSelection(volumePlanes, heuristicOrigin, config)
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.
- 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.
- Return type
Promise <
IncrementalSelectionId()
>- Returns
The handle for the selection context.
beginRayDrillSelection
- View.beginRayDrillSelection(rayCssOrigin, rayCssBoxRadius, config)
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.- 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.
- Return type
Promise <
IncrementalSelectionId()
>- Returns
The handle for the selection context.
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.
beginScreenSelectByArea
- View.beginScreenSelectByArea(areaCssMin, areaCssMax, config)
Creates a new and active selection context for the provided selection window.
- 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.
- Return type
Promise <
IncrementalSelectionId()
>- Returns
The handle for the selection context.
beginSphereSelection
- View.beginSphereSelection(sphereCenter, sphereRadius, config)
Creates a new and active selection context for the provided selection sphere.
- 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.
- Return type
Promise <
IncrementalSelectionId()
>- Returns
The handle for the selection context.
centerCameraOnNode
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
See also: -
InstanceModifier.DoNotLight
-setLightingEnabled
compositePickFromPoint
- View.compositePickFromPoint(point, config)
Performs a composite picking operation. This operation will return all candidate Node entities according to the PickConfig.
- Arguments
point (
Point2()
) – Canvas position to pick from.config (
PickConfig()
) – The configuration object used for this picking operation.
- Return type
Promise <
CompositeSelectionItem()
>- Returns
An object containing the result of the picking operation.
endComparison
- View.endComparison()
Disables a visual comparison of two sets of nodes enabled by
startComparison
- Return type
void
endIncrementalSelection
- View.endIncrementalSelection(handle)
Deactivates and destroys the provided selection context.
- Arguments
handle (
IncrementalSelectionId()
) – The selection context to destroy.
- Return type
endVolumeSelection
- View.endVolumeSelection(handle)
- Deprecated
Use
endIncrementalSelection
instead.- Arguments
handle (
IncrementalSelectionId()
) –
- Return type
fitBounding
- View.fitBounding(bounding[, duration[, camera]])
Fits the camera to the bounding box.
fitNodes
- View.fitNodes(ids[, duration])
Fits the camera to the bounding box containing the node ids.
- Arguments
ids ([NodeId]) –
duration (
number()
) – optional Time in milliseconds for the camera transition to the new camera view.
- Return type
Promise <void>
- Returns
A promise that will be resolved once the transition is complete.
fitWorld
- View.fitWorld([duration[, camera]])
Fits the view to the model bounding box.
- Arguments
duration (
number()
) – optional the number of milliseconds to transition to the new camera.camera (
Camera()
) – optional
- Return type
Promise <void>
- Returns
A promise that will be resolved once the transition is complete.
getAmbientLightColor
getAmbientOcclusionEnabled
- View.getAmbientOcclusionEnabled()
- Return type
boolean
- Returns
boolean value indicating whether ambient occlusion is enabled
getAmbientOcclusionRadius
- View.getAmbientOcclusionRadius()
- Return type
number
- Returns
the ambient occlusion radius
getAntiAliasingMode
- View.getAntiAliasingMode()
Gets the anti-aliasing mode for the scene. The Default value is AntiAliasingMode.SMAA
- Return type
- Returns
the current anti-aliasing mode.
getAxisTriad
- View.getAxisTriad()
- Return type
getBackfacesVisible
- View.getBackfacesVisible()
Gets whether backfaces are being rendered in the scene.
- Return type
boolean
- Returns
Boolean value indicating whether backfaces are being rendered in the scene.
getBackgroundColor
- View.getBackgroundColor()
Returns the background colors of the canvas.
- Return type
- Returns
the canvas background colors.
getBloomEnabled
- View.getBloomEnabled()
Returns whether bloom is enabled.
See
setBloomEnabled
- Return type
boolean
See
setBloomEnabled
getBloomIntensityScale
- View.getBloomIntensityScale()
Gets the intensity of the bloom effect.
See
setBloomIntensityScale
- Return type
number
See
setBloomIntensityScale
getBloomLayers
- View.getBloomLayers()
Returns an array of objects describing each layer in the bloom effect.
See
setBloomLayers
- Return type
See
setBloomLayers
getBloomThreshold
- View.getBloomThreshold()
Returns the minimum luminance value a pixel must have for it to contribute to bloom.
See
setBloomThreshold
getBloomThresholdRampWidth
- Return type
number
See
setBloomThreshold
getBloomThresholdRampWidth
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
See
setBloomThresholdRampWidth
getBoundingCalculationIgnoresInvisible
- View.getBoundingCalculationIgnoresInvisible()
- Return type
boolean
- Returns
whether or not bounding calculations by this View object ignores invisible geometry.
getCamera
getCanvasSize
getDrawMode
getDrawStrategy
- View.getDrawStrategy()
Gets the draw strategy.
- Return type
- Returns
The current draw strategy.
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()
- Return type
Promise <boolean>
- Returns
boolean value indicating if eye-dome lighting is enabled or disabled.
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.
- Return type
boolean
- Returns
whether faces are currently being drawn.
getFullCameraMatrix
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
See also: -
setGroundPlane
getHardEdgeColor
getHardEdgeOpacity
- View.getHardEdgeOpacity()
Returns the opacity of hard edges.
See also: -
setHardEdgeOpacity
-setHardEdgesEnabled
- Return type
number
See also: -
setHardEdgeOpacity
-setHardEdgesEnabled
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
See also: -
setHardEdgeThreshold
-setHardEdgeThresholdRampWidth
-setHardEdgesEnabled
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
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
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
Hard edges are always enabled in hidden line mode, regardless of the return value.
See
setHardEdgesEnabled
getImageBasedLightingEnabled
- View.getImageBasedLightingEnabled()
Returns whether image-based lighting is enabled for physically-based materials.
See also: -
setImageBasedLightingEnabled
-setImageBasedLightingIntensity
-setImageBasedLightingOrientation
- Return type
boolean
See also: -
setImageBasedLightingEnabled
-setImageBasedLightingIntensity
-setImageBasedLightingOrientation
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
The default value is 1.
See also: -
setImageBasedLightingIntensity
-setImageBasedLightingEnabled
-setImageBasedLightingOrientation
getImageBasedLightingOrientation
- View.getImageBasedLightingOrientation()
Returns the orientation of the image-based lighting environment applied to physically-based materials.
See also: -
setImageBasedLightingOrientation
-setImageBasedLightingEnabled
-setImageBasedLightingIntensity
- Return type
See also: -
setImageBasedLightingOrientation
-setImageBasedLightingEnabled
-setImageBasedLightingIntensity
getInteractiveDrawLimitIncreaseEnabled
- View.getInteractiveDrawLimitIncreaseEnabled()
Gets whether or not the viewer will periodically attempt to increase the amount drawn during interaction.
- Return type
Promise <boolean>
- Returns
boolean value indicating whether this feature is enabled or not
getLight
getLightKeys
getLightingEnabled
- View.getLightingEnabled()
Returns whether lighting is enabled.
See also
setLightingEnabled
- Return type
boolean
See also
setLightingEnabled
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
Line jitter makes lines look ‘sketchy’ by drawing them multiple times with randomized offsets applied to the vertices.
See also: -
setLineJitterEnabled
-getLineJitterInstanceCount
-getLineJitterRadius
-getLineJitterFrequency
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
See also: -
getLineJitterEnabled
-getLineJitterInstanceCount
-getLineJitterRadius
-setLineJitterFrequency
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
See also: -
getLineJitterEnabled
-setLineJitterInstanceCount
-getLineJitterRadius
-getLineJitterFrequency
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
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
getLineVisibility
- View.getLineVisibility()
Gets the line visibility for the view.
- Return type
boolean
- Returns
whether lines are currently being drawn.
getMassageExtremeCameras
- View.getMassageExtremeCameras()
- Return type
boolean
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
getProjectionMode
- View.getProjectionMode()
Gets the projection mode.
- Return type
- Returns
The current projection mode.
getSilhouetteColor
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
Silhouette edges are always enabled in hidden line mode, regardless of the return value.
See
setSilhouetteEnabled
getSilhouetteOpacity
- View.getSilhouetteOpacity()
Returns the opacity of silhouette edges.
See also: -
setSilhouetteOpacity
-setSilhouetteEnabled
- Return type
number
See also: -
setSilhouetteOpacity
-setSilhouetteEnabled
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
The value is a proportion of the canvas size and not a world-space distance.
See also: -
setSilhouetteThreshold
-setSilhouetteThresholdRampWidth
-setSilhouetteEnabled
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
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
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 beyondfarDistance
.Attenuation is disabled if
farDistance
is less than or equal tonearDistance
.See also: -
setSimpleReflectionAttenuation
-setSimpleReflectionEnabled
- Return type
function
- Returns
An object with the following properties:
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: -
setSimpleReflectionAttenuation
-setSimpleReflectionEnabled
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)
See also: -
setSimpleReflectionBlurInterval
-setSimpleReflectionEnabled
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
See also: -
setSimpleReflectionBlurSamples
-setSimpleReflectionEnabled
getSimpleReflectionEnabled
- View.getSimpleReflectionEnabled()
Returns whether simple reflections are enabled.
See
setSimpleReflectionEnabled
- Return type
boolean
See
setSimpleReflectionEnabled
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
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
getSimpleReflectionOpacity
- View.getSimpleReflectionOpacity()
Returns the opacity of simple reflections.
See also: -
setSimpleReflectionOpacity
-setSimpleReflectionEnabled
- Return type
number
See also: -
setSimpleReflectionOpacity
-setSimpleReflectionEnabled
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
See also: -
setSimpleShadowBlurInterval
-setSimpleShadowEnabled
getSimpleShadowBlurSamples
- View.getSimpleShadowBlurSamples()
Returns the diameter of the blur filter used for simple shadows.
See also: -
setSimpleShadowBlurSamples
-setSimpleShadowEnabled
- Return type
number
See also: -
setSimpleShadowBlurSamples
-setSimpleShadowEnabled
getSimpleShadowColor
getSimpleShadowEnabled
- View.getSimpleShadowEnabled()
Returns whether simple shadows are enabled.
See
setSimpleShadowEnabled
- Return type
boolean
See
setSimpleShadowEnabled
getSimpleShadowInteractiveUpdateEnabled
- View.getSimpleShadowInteractiveUpdateEnabled()
Returns whether simple shadows will be updated during user interaction.
See also: -
setSimpleShadowInteractiveUpdateEnabled
-setSimpleShadowEnabled
- Return type
boolean
See also: -
setSimpleShadowInteractiveUpdateEnabled
-setSimpleShadowEnabled
getSimpleShadowOpacity
- View.getSimpleShadowOpacity()
Returns the opacity of simple shadows.
See also: -
setSimpleShadowOpacity
-setSimpleShadowEnabled
- Return type
number
See also: -
setSimpleShadowOpacity
-setSimpleShadowEnabled
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
See also: -
getSimpleShadowResolution
-setSimpleShadowEnabled
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
getViewOrientationCamera
- View.getViewOrientationCamera(orientation[, bounding[, preserveModelUp]])
Returns a camera set to a ViewOrientation
- 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()
) – optional
- Return type
Promise <
Camera()
>
isolateNodes
- View.isolateNodes(nodeIds[, duration[, fitNodes[, initiallyHiddenStayHidden]]])
Hides all nodes except those specified. Also fits the camera to those nodes’ bounding box.
- Arguments
nodeIds ([NodeId]) – An array of the node IDs to be isolated.
duration (
number()
) – optional Time in milliseconds for the camera transition to the new camera view.fitNodes (
boolean()
) – optional If true, then the view is fitted around the isolated nodes.initiallyHiddenStayHidden (
boolean | null()
) – optional Controls whether or not initially hidden geometries stay hidden. Default behavior is driven bysetBehaviorInitiallyHidden
- Return type
Promise <void>
pickAllFromPoint
- View.pickAllFromPoint(point, config)
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.
- Arguments
point (
Point2()
) – Canvas position to pick from.config (
PickConfig()
) – The configuration object used for this picking operation.
- Return type
Promise <[
NodeEntitySelectionItem()
]>- Returns
An object containing the result of the picking operation.
pickAllFromRay
- View.pickAllFromRay(ray, config)
Performs a selection operation from the given world-space ray. All candidate entities are returned. This method does not trigger a selection event.
- Arguments
ray (
Ray()
) – The world-space ray to perform the selection with.config (
PickConfig()
) – The configuration object used for this picking operation.
- Return type
Promise <[
NodeEntitySelectionItem()
]>- Returns
An object containing the result of the picking operation.
pickFromPoint
- View.pickFromPoint(point, config)
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.
- Arguments
point (
Point2()
) – Canvas position to pick from.config (
PickConfig()
) – The configuration object used for this picking operation.
- Return type
Promise <
SelectionItem()
>- Returns
An object containing the result of the picking operation.
pickFromRay
- View.pickFromRay(ray, config)
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.
- Arguments
ray (
Ray()
) – The world-space ray to perform the selection with.config (
PickConfig()
) – The configuration object used for this picking operation.
- Return type
Promise <
SelectionItem()
>- Returns
An object containing the result of the picking operation.
pointToWindowPosition
projectPoint
raycastFromPoint
removeLight
resetCamera
- View.resetCamera([duration])
Resets the camera to the initial view of the model when first loaded.
- Arguments
duration (
number()
) – optional the amount of time in milliseconds that the camera transition between the current and initial view should take.
- Return type
Promise <void>
setAmbientLightColor
- View.setAmbientLightColor(value)
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
- Arguments
value (
Color()
) –
- Return type
void
See also
getAmbientLightColor
setAmbientOcclusionEnabled
- View.setAmbientOcclusionEnabled([enabled])
Sets whether ambient occlusion is enabled
- Arguments
enabled (
boolean()
) – optional sets whether ambient occlusion will be enabled
- Return type
setAmbientOcclusionRadius
- View.setAmbientOcclusionRadius(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.
- Arguments
radius (
number()
) – the ambient occlusion radius.
- Return type
setAntiAliasingMode
- View.setAntiAliasingMode(antiAliasingMode)
Sets the anti-aliasing mode for the scene.
- Arguments
antiAliasingMode (AntiAliasingMode) –
- Return type
setBackfacesVisible
- View.setBackfacesVisible(visible)
Sets whether backfaces should be rendered in the scene.
- Arguments
visible (
boolean()
) – Boolean value indicating whether backfaces should be rendered.
- Return type
- Returns
Promise that is resolved when this operation has completed.
setBackgroundColor
- View.setBackgroundColor([top[, bottom]])
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 {@link DrawMode.HiddenLine}, the background color is defined in {@link Communicator.Settings.HiddenLineSettings HiddenLineSettings}. See {@link Communicator.Settings.HiddenLineSettings.setBackgroundColor HiddenLineSettings.setBackgroundColor}.
- Arguments
- Return type
- Returns
a promise that resolves when the operation has completed.
When draw mode is set to {@link DrawMode.HiddenLine}, the background color is defined in {@link Communicator.Settings.HiddenLineSettings HiddenLineSettings}. See {@link Communicator.Settings.HiddenLineSettings.setBackgroundColor HiddenLineSettings.setBackgroundColor}.
setBloomEnabled
- View.setBloomEnabled([value])
Sets whether bloom is enabled.
See
getBloomEnabled
- Arguments
value (
boolean()
) – optional
- Return type
void
See
getBloomEnabled
setBloomIntensityScale
- View.setBloomIntensityScale(value)
Sets the intensity of the bloom effect. This value is multiplied by the intensities of the individual layers set by
setBloomLayers
See
getBloomIntensityScale
- Arguments
value (
number()
) –
- Return type
void
See
getBloomIntensityScale
setBloomLayers
- View.setBloomLayers(layers)
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
- Arguments
layers ([
BloomLayerInfo()
]) –
- Return type
void
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
setBloomThreshold
- View.setBloomThreshold(value)
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
- Arguments
value (
number()
) –
- Return type
void
See
getBloomThreshold
setBloomThresholdRampWidth
setBloomThresholdRampWidth
- View.setBloomThresholdRampWidth(value)
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
- Arguments
value (
number()
) –
- Return type
void
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
setBoundingCalculationIgnoresInvisible
- View.setBoundingCalculationIgnoresInvisible(value)
Sets whether or not bounding calculations by this View object ignores invisible geometry.
- Arguments
value (
boolean()
) –
- Return type
void
setCamera
setDisplayIncompleteFrames
- View.setDisplayIncompleteFrames(value)
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.- Arguments
value (
boolean()
) –
- Return type
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.
setDrawMode
setEyeDomeLightingBlurEdgeDistance
- View.setEyeDomeLightingBlurEdgeDistance(value)
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)
- Arguments
value (
number()
) –
- Return type
setEyeDomeLightingBlurInterval
- View.setEyeDomeLightingBlurInterval(value)
Sets the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds. (default: 1)
- Arguments
value (
number()
) –
- Return type
setEyeDomeLightingBlurSamples
- View.setEyeDomeLightingBlurSamples(value)
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)
- Arguments
value (
number()
) –
- Return type
setEyeDomeLightingEnabled
- View.setEyeDomeLightingEnabled([enabled])
Enables or disables eye-dome lighting for point clouds. (default: disabled)
- Arguments
enabled (
boolean()
) – optional
- Return type
setEyeDomeLightingOpacity
- View.setEyeDomeLightingOpacity(value)
Sets the opacity of the shading rendered by eye-dome lighting for point clouds. (default: 1)
- Arguments
value (
number()
) – A number in the range [0,1].
- Return type
setEyeDomeLightingShadingEdgeDistance
- View.setEyeDomeLightingShadingEdgeDistance(value)
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)
- Arguments
value (
number()
) –
- Return type
setFaceVisibility
- View.setFaceVisibility(faceVisibility)
Sets the face visibility for the view.
- Arguments
faceVisibility (
boolean()
) – indicates whether to draw faces.
- Return type
setGoochBaseColorProminence
- View.setGoochBaseColorProminence(prominence)
Sets the prominence of the object’s base color in Gooch shading.
- Arguments
prominence (
number()
) – this scalar value determines the amount of the object’s base color is applied to the final shaded color.
- Return type
void
setGoochBlue
- View.setGoochBlue(blue)
Sets the value to use as the blue tone in Gooch shading.
- Arguments
blue (
number()
) – the blue tone. This value should be in the range [0,1]
- Return type
void
setGoochLuminanceShiftStrength
- View.setGoochLuminanceShiftStrength(shiftStrength)
Sets the strength of the luminance shift in Gooch shading.
- Arguments
shiftStrength (
number()
) – this scalar values determines the amount of luminance shift that is applied to the object’s base color
- Return type
void
setGoochYellow
- View.setGoochYellow(yellow)
Sets the value to use as the yellow tone in Gooch shading.
- Arguments
yellow (
number()
) – the yellow tone. This value should be in the range [0,1]
- Return type
void
setGroundPlane
- View.setGroundPlane(plane)
Defines the invisible ground plane onto which simple shadows and reflections are projected.
See also: -
getGroundPlane
-setSimpleShadowEnabled
-setSimpleReflectionEnabled
- Arguments
plane (
GroundPlane()
) – The plane to set.
- Return type
void
See also: -
getGroundPlane
-setSimpleShadowEnabled
-setSimpleReflectionEnabled
setHardEdgeColor
setHardEdgeOpacity
- View.setHardEdgeOpacity(value)
Sets the opacity of hard edges.
See also: -
getHardEdgeOpacity
-setHardEdgesEnabled
- Arguments
value (
number()
) – The opacity to set.
- Return type
void
See also: -
getHardEdgeOpacity
-setHardEdgesEnabled
setHardEdgeThreshold
- View.setHardEdgeThreshold(degrees)
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
- Arguments
degrees (
number()
) – The threshold to set.
- Return type
void
See also: -
getHardEdgeThreshold
-setHardEdgeThresholdRampWidth
-setHardEdgesEnabled
setHardEdgeThresholdRampWidth
- View.setHardEdgeThresholdRampWidth(degrees)
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
- Arguments
degrees (
number()
) –
- Return type
void
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
setHardEdgesEnabled
- View.setHardEdgesEnabled([value])
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
- Arguments
value (
boolean()
) – optional Whether hard edges should be enabled.
- Return type
void
Hard edges are always enabled in hidden line mode.
See also: -
getHardEdgesEnabled
-setHardEdgeColor
-setHardEdgeOpacity
-setHardEdgeThreshold
-setHardEdgeThresholdRampWidth
setImageBasedLightingEnabled
- View.setImageBasedLightingEnabled(value)
Sets whether image-based lighting is enabled for physically-based materials.
See also: -
getImageBasedLightingEnabled
-setImageBasedLightingIntensity
-setImageBasedLightingOrientation
- Arguments
value (
boolean()
) –
- Return type
void
See also: -
getImageBasedLightingEnabled
-setImageBasedLightingIntensity
-setImageBasedLightingOrientation
setImageBasedLightingEnvironment
- View.setImageBasedLightingEnvironment(data)
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:
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
- Arguments
data (
Uint8Array | null()
) –
- Return type
void
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:
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
setImageBasedLightingIntensity
- View.setImageBasedLightingIntensity(value)
Sets the intensity (brightness) of image-based lighting applied to physically-based materials.
The default value is 1.
See also: -
getImageBasedLightingIntensity
-setImageBasedLightingEnabled
-setImageBasedLightingOrientation
- Arguments
value (
number()
) –
- Return type
void
The default value is 1.
See also: -
getImageBasedLightingIntensity
-setImageBasedLightingEnabled
-setImageBasedLightingOrientation
setImageBasedLightingOrientation
- View.setImageBasedLightingOrientation(value)
Sets the orientation of the image-based lighting environment applied to physically-based materials.
See also: -
getImageBasedLightingOrientation
-setImageBasedLightingEnabled
-setImageBasedLightingIntensity
- Arguments
value (
ImageBasedLightingOrientation()
) –
- Return type
void
See also: -
getImageBasedLightingOrientation
-setImageBasedLightingEnabled
-setImageBasedLightingIntensity
setInitialCamera
setInteractiveDrawDelay
- View.setInteractiveDrawDelay(value)
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.
- Arguments
value (
number()
) – The delay in milliseconds
- Return type
setInteractiveDrawLimitIncreaseEnabled
- View.setInteractiveDrawLimitIncreaseEnabled(enable)
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.- Arguments
enable (
boolean()
) –
- Return type
void
setLightingEnabled
- View.setLightingEnabled([enabled])
Sets whether lighting is enabled. When disabled, material colors are drawn at full intensity.
See also
InstanceModifier.DoNotLight
clearLights
- Arguments
enabled (
boolean()
) – optional
- Return type
See also
InstanceModifier.DoNotLight
clearLights
setLineJitterEnabled
- View.setLineJitterEnabled([value])
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
- Arguments
value (
boolean()
) – optional
- Return type
void
Line jitter makes lines look ‘sketchy’ by drawing them multiple times with randomized offsets applied to the vertices.
See also: -
getLineJitterEnabled
-setLineJitterInstanceCount
-setLineJitterRadius
-setLineJitterFrequency
setLineJitterFrequency
- View.setLineJitterFrequency(value)
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
- Arguments
value (
number()
) –
- Return type
void
Decreasing this value causes lines to appear smoother, while increasing it causes lines to look more noisy.
See also: -
setLineJitterEnabled
-setLineJitterInstanceCount
-setLineJitterRadius
-getLineJitterFrequency
setLineJitterInstanceCount
- View.setLineJitterInstanceCount(value)
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
- Arguments
value (
number()
) –
- Return type
void
Increasing this number can make the lines look more ‘sketchy.’
See also: -
setLineJitterEnabled
-getLineJitterInstanceCount
-setLineJitterRadius
-setLineJitterFrequency
setLineJitterRadius
- View.setLineJitterRadius(value)
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
- Arguments
value (
number()
) –
- Return type
void
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
setLineVisibility
- View.setLineVisibility(lineVisibility)
Sets the line visibility for the view.
- Arguments
lineVisibility (
boolean()
) – indicates whether to draw lines.
- Return type
setMassageExtremeCameras
- View.setMassageExtremeCameras(value)
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
- Arguments
value (
boolean()
) – Whether to modify cameras
- Return type
void
setPointShape
- View.setPointShape(shape)
Controls the appearance of rendered points. (default: Square) See
PointShape
- Arguments
shape (PointShape) –
- Return type
setPointSize
- View.setPointSize(size, unit)
Sets the diameter of rendered points. (default: 1, ScreenPixels) See
PointSizeUnit
- Arguments
size (
number()
) –unit (PointSizeUnit) –
- Return type
setPointVisibilityTest
- View.setPointVisibilityTest(points)
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
- Arguments
points ([
Point3()
]) – The points to test. An empty array will disable the test.
- Return type
void
The results are passed to the
CallbackMap.frameDrawn
callback so that UI elements may be updated in sync with rendering.See also
testPointVisibility
setProjectionMode
- View.setProjectionMode(projectionMode)
Sets the projection mode.
- Arguments
projectionMode (Projection) –
- Return type
void
setSilhouetteColor
setSilhouetteEnabled
- View.setSilhouetteEnabled([value])
Enables or disables silhouette edges.
Silhouette edges are always enabled in hidden line mode.
See also: -
getSilhouetteEnabled
-setSilhouetteColor
-setSilhouetteOpacity
-setSilhouetteThreshold
-setSilhouetteThresholdRampWidth
- Arguments
value (
boolean()
) – optional Whether silhouette edges should be enabled.
- Return type
void
Silhouette edges are always enabled in hidden line mode.
See also: -
getSilhouetteEnabled
-setSilhouetteColor
-setSilhouetteOpacity
-setSilhouetteThreshold
-setSilhouetteThresholdRampWidth
setSilhouetteOpacity
- View.setSilhouetteOpacity(value)
Sets the opacity of silhouette edges.
See also: -
getSilhouetteOpacity
-setSilhouetteEnabled
- Arguments
value (
number()
) – The opacity to set.
- Return type
void
See also: -
getSilhouetteOpacity
-setSilhouetteEnabled
setSilhouetteThreshold
- View.setSilhouetteThreshold(value)
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
- Arguments
value (
number()
) – The threshold to set.
- Return type
void
The value is a proportion of the canvas size and not a world-space distance.
See also: -
getSilhouetteThreshold
-setSilhouetteThresholdRampWidth
-setSilhouetteEnabled
setSilhouetteThresholdRampWidth
- View.setSilhouetteThresholdRampWidth(value)
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
- Arguments
value (
number()
) –
- Return type
void
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
setSimpleReflectionAttenuation
- View.setSimpleReflectionAttenuation(nearDistance, farDistance[, unit])
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: -
getSimpleReflectionAttenuation
-setSimpleReflectionEnabled
- 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) – optional The unit in which
nearDistance
andfarDistance
are specified. If unspecified,SimpleReflectionAttenuationUnit.World
will be used.
- Return type
void
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: -
getSimpleReflectionAttenuation
-setSimpleReflectionEnabled
setSimpleReflectionBlurInterval
- View.setSimpleReflectionBlurInterval(value[, unit])
Sets the distance between samples taken by the blur filter used for simple reflections.
See also: -
getSimpleReflectionBlurInterval
-setSimpleReflectionEnabled
- Arguments
value (
number()
) – The interval to set.unit (BlurIntervalUnit) – optional The unit in which the
value
argument is specified.
- Return type
void
See also: -
getSimpleReflectionBlurInterval
-setSimpleReflectionEnabled
setSimpleReflectionBlurSamples
- View.setSimpleReflectionBlurSamples(value)
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
- Arguments
value (
number()
) –
- Return type
void
See also: -
getSimpleReflectionBlurSamples
-setSimpleReflectionEnabled
setSimpleReflectionEnabled
- View.setSimpleReflectionEnabled([value])
Enables or disables simple reflections projected onto an invisible ground plane.
See also: -
getSimpleReflectionEnabled
-setSimpleReflectionOpacity
-setSimpleReflectionBlurSamples
-setSimpleReflectionBlurInterval
-setSimpleReflectionFadeAngle
- Arguments
value (
boolean()
) – optional
- Return type
void
See also: -
getSimpleReflectionEnabled
-setSimpleReflectionOpacity
-setSimpleReflectionBlurSamples
-setSimpleReflectionBlurInterval
-setSimpleReflectionFadeAngle
setSimpleReflectionFadeAngle
- View.setSimpleReflectionFadeAngle(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
- Arguments
degrees (
number()
) – The angle in degrees.
- Return type
void
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
setSimpleReflectionOpacity
- View.setSimpleReflectionOpacity(value)
Sets the opacity of simple reflections.
See also: -
getSimpleReflectionOpacity
-setSimpleReflectionEnabled
- Arguments
value (
number()
) –
- Return type
void
See also: -
getSimpleReflectionOpacity
-setSimpleReflectionEnabled
setSimpleShadowBlurInterval
- View.setSimpleShadowBlurInterval(value)
Sets the distance in pixels between samples taken by the blur filter used for simple shadows.
See also: -
getSimpleShadowBlurInterval
-setSimpleShadowEnabled
- Arguments
value (
number()
) – The interval to set.
- Return type
void
See also: -
getSimpleShadowBlurInterval
-setSimpleShadowEnabled
setSimpleShadowBlurSamples
- View.setSimpleShadowBlurSamples(value)
Sets the diameter of the blur filter used for simple shadows. Setting the value to
0
will disable blurring.See also: -
getSimpleShadowBlurSamples
-setSimpleShadowEnabled
- Arguments
value (
number()
) – The number of samples.
- Return type
void
See also: -
getSimpleShadowBlurSamples
-setSimpleShadowEnabled
setSimpleShadowColor
setSimpleShadowEnabled
- View.setSimpleShadowEnabled([value])
Enables or disables a full-scene shadow projected onto an invisible ground plane.
See also: -
getSimpleShadowEnabled
-setSimpleShadowColor
-setSimpleShadowOpacity
-setGroundPlane
-setSimpleShadowResolution
-setSimpleShadowInteractiveUpdateEnabled
- Arguments
value (
boolean()
) – optional Whether simple shadows should be enabled.
- Return type
void
See also: -
getSimpleShadowEnabled
-setSimpleShadowColor
-setSimpleShadowOpacity
-setGroundPlane
-setSimpleShadowResolution
-setSimpleShadowInteractiveUpdateEnabled
setSimpleShadowInteractiveUpdateEnabled
- View.setSimpleShadowInteractiveUpdateEnabled([value])
Enables or disables updates to simple shadows during user interaction.
See also: -
getSimpleShadowInteractiveUpdateEnabled
-setSimpleShadowEnabled
- Arguments
value (
boolean()
) – optional
- Return type
void
See also: -
getSimpleShadowInteractiveUpdateEnabled
-setSimpleShadowEnabled
setSimpleShadowOpacity
- View.setSimpleShadowOpacity(opacity)
Sets the opacity of simple shadows.
See also: -
getSimpleShadowOpacity
-setSimpleShadowEnabled
- Arguments
opacity (
number()
) – The opacity to set.
- Return type
void
See also: -
getSimpleShadowOpacity
-setSimpleShadowEnabled
setSimpleShadowResolution
- View.setSimpleShadowResolution(pixels)
Sets the width and height in pixels of the texture image into which simple shadows are drawn.
See also: -
getSimpleShadowResolution
-setSimpleShadowEnabled
- Arguments
pixels (
number()
) – The resolution to set.
- Return type
void
See also: -
getSimpleShadowResolution
-setSimpleShadowEnabled
setStatisticsDisplayVisibility
- View.setStatisticsDisplayVisibility(visibility)
Sets the display for the default statistic overlay.
- Arguments
visibility (
boolean()
) –
- Return type
Promise <void>
setToonShadingBandCount
- View.setToonShadingBandCount(bandCount)
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.
- Arguments
bandCount (
number()
) –
- Return type
void
setToonShadingSpecularFactor
- View.setToonShadingSpecularFactor(specularFactor)
Sets a scale factor which controls the size of specular highlights when toon shading is enabled. The default value is 1.0.
- Arguments
specularFactor (
number()
) –
- Return type
void
setTransparencyMode
- View.setTransparencyMode(mode)
Sets how transparent objects are blended.
- Arguments
mode (TransparencyMode) –
- Return type
void
setViewOrientation
- View.setViewOrientation(orientation[, duration[, bounding[, preserveModelUp]]])
Sets the view to a standard orientation.
- Arguments
orientation (ViewOrientation) – The desired view orientation for the camera.
duration (
number()
) – optional 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()
) – optional Indicates whether the camera up will be set according to model up or current camera.
- Return type
Promise <void>
setXRayColor
- View.setXRayColor(element, color[, group])
Sets the color applied to nodes in x-ray mode. By default, the color is unset.
See
unsetXRayColor
- Arguments
element (ElementType) – the type of geometry to apply the color to
color (
Color()
) – the color to applygroup (XRayGroup) – optional the category of nodes that will be affected. If unspecified,
XRayGroup.Selected
will be used.
- Return type
See
unsetXRayColor
setXRayOpacity
- View.setXRayOpacity(opacity[, element])
Sets the opacity of unselected items in x-ray mode.
- Arguments
opacity (
number()
) – a number between 0 and 1element (ElementType) – optional the type of element to which the opacity will apply. If unspecified, the opacity will apply to all element types.
- Return type
setXRayTransparencyMode
- View.setXRayTransparencyMode(mode)
Sets how transparent (unselected) objects are blended in x-ray mode.
- Arguments
mode (XRayTransparencyMode) –
- Return type
startComparison
- View.startComparison(nodeIdSet1, nodeIdSet2[, config])
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
- Arguments
nodeIdSet1 ([NodeId]) – the nodes to compare against
nodeIdSet2
nodeIdSet2 ([NodeId]) – the nodes to compare against
nodeIdSet1
config (
ComparisonConfig()
) – optional settings controlling the behavior of the comparison
- Return type
void
See
endComparison
testPointVisibility
- View.testPointVisibility(points)
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.- Arguments
points ([
Point3()
]) – The points to test.
- Return type
Promise <[number]>
- Returns
A list of indices of the visible points.
If the test is to be run every time a frame is drawn,
setPointVisibilityTest
should be used instead for proper synchronization.
unprojectPoint
unsetXRayColor
- View.unsetXRayColor(element[, group])
Unsets the color applied to selected items in x-ray mode. Selected items will be displayed without overriding their colors.
See
setXRayColor
- Arguments
element (ElementType) – the type of geometry affected by the change
group (XRayGroup) – optional the category of nodes that will be affected. If unspecified,
XRayGroup.Selected
will be used.
- Return type
Promise <void>
See
setXRayColor