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
Methods
addLight
- Communicator.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
- Arguments
light (
Communicator.Light()
) –
- Return type
Promise[Communicator.LightKey]
See also: -
clearLights
-removeLight
-updateLight
-setAmbientLightColor
advanceIncrementalSelection
- Communicator.View.advanceIncrementalSelection(handle)
Returns the next batch of geometry selected by the supplied selection context.
- Arguments
handle (
Communicator.Selection.IncrementalSelectionId()
) – The handle to an active area selection context.
- Return type
Promise[{ }]
- Returns
Returns selected items. If the resulting list is null then there are no more items to select.
advanceVolumeSelection
- Communicator.View.advanceVolumeSelection(handle)
Note
advanceVolumeSelection is deprecated: Use
advanceIncrementalSelection
instead.- Arguments
handle (
Communicator.Selection.IncrementalSelectionId()
) –
- Return type
Promise[{ }]
beginConvexPolyhedronSelection
- Communicator.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 (
[Communicator.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 (
Communicator.Point3()
) – A point used to compute distances against for prioritizing returned results. This is typically (but not necessarily) the center of the volume.config (
Communicator.IncrementalPickConfig()
) – The configuration object used for this selection operation.
- Return type
Promise[Communicator.Selection.IncrementalSelectionId]
- Returns
The handle for the selection context.
beginRayDrillSelection
- Communicator.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.
- Arguments
rayCssOrigin (
Communicator.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 (
Communicator.IncrementalPickConfig()
) – The configuration object used for this selection operation.
- Return type
Promise[Communicator.Selection.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
- Communicator.View.beginScreenSelectByArea(areaCssMin, areaCssMax, config)
Creates a new and active selection context for the provided selection window.
- Arguments
areaCssMin (
Communicator.Point2()
) – The minimum coodinate in CSS pixel space for the selection window.areaCssMax (
Communicator.Point2()
) – The maximum coodinate in CSS pixel space for the selection window.config (
Communicator.IncrementalPickConfig()
) – The configuration object used for this selection operation.
- Return type
Promise[Communicator.Selection.IncrementalSelectionId]
- Returns
The handle for the selection context.
beginSphereSelection
- Communicator.View.beginSphereSelection(sphereCenter, sphereRadius, config)
Creates a new and active selection context for the provided selection sphere.
- Arguments
sphereCenter (
Communicator.Point3()
) – The center of the selection sphere.sphereRadius (
number()
) – The radius of the selection sphere.config (
Communicator.IncrementalPickConfig()
) – The configuration object used for this selection operation.
- Return type
Promise[Communicator.Selection.IncrementalSelectionId]
- Returns
The handle for the selection context.
centerCameraOnNode
- Communicator.View.centerCameraOnNode(nodeId, duration, camera)
Centers the camera on a specified node id.
- Arguments
nodeId (
Communicator.NodeId()
) –duration (
{ }()
) – the number of milliseconds to transition to the new camera.camera (
Communicator.Camera()
) –
- Return type
Promise[void]
clearLights
- Communicator.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)
.- Return type
void
See also: -
InstanceModifier.DoNotLight
-setLightingEnabled
compositePickFromPoint
- Communicator.View.compositePickFromPoint(point, config)
Performs a composite picking operation. This operation will return all candidate Node entities according to the PickConfig.
- Arguments
point (
Communicator.Point2()
) – Canvas position to pick from.config (
Communicator.PickConfig()
) – The configuration object used for this picking operation.
- Return type
Promise[Communicator.Selection.CompositeSelectionItem]
- Returns
An object containing the result of the picking operation.
endComparison
- Communicator.View.endComparison()
Disables a visual comparison of two sets of nodes enabled by
startComparison
- Return type
void
endIncrementalSelection
- Communicator.View.endIncrementalSelection(handle)
Deactivates and destroys the provided selection context.
- Arguments
handle (
Communicator.Selection.IncrementalSelectionId()
) – The selection context to destroy.
- Return type
Communicator.DeprecatedPromise
endVolumeSelection
- Communicator.View.endVolumeSelection(handle)
Note
endVolumeSelection is deprecated: Use
endIncrementalSelection
instead.- Arguments
handle (
Communicator.Selection.IncrementalSelectionId()
) –
- Return type
Communicator.DeprecatedPromise
fitBounding
- Communicator.View.fitBounding(bounding, duration, camera)
Fits the camera to the bounding box.
- Arguments
bounding (
Communicator.Box()
) – bounding box to fit the camera.duration (
{ }()
) – Time in milliseconds for the camera transition to the new camera view.camera (
Communicator.Camera()
) –
- Return type
Promise[void]
- Returns
A promise that will be resolved once the transition is complete.
fitNodes
- Communicator.View.fitNodes(ids, duration)
Fits the camera to the bounding box containing the node ids.
- Arguments
ids (
[Communicator.NodeId]()
) –duration (
{ }()
) – 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
- Communicator.View.fitWorld(duration, camera)
Fits the view to the model bounding box.
- Arguments
duration (
{ }()
) – the number of milliseconds to transition to the new camera.camera (
Communicator.Camera()
) –
- Return type
Promise[void]
- Returns
A promise that will be resolved once the transition is complete.
getAmbientLightColor
- Communicator.View.getAmbientLightColor()
Gets the color of the ambient light applied to the scene.
- Return type
Communicator.Color
See also
setAmbientLightColor
getAmbientOcclusionEnabled
- Communicator.View.getAmbientOcclusionEnabled()
- Return type
boolean
- Returns
boolean value indicating whether ambient occlusion is enabled
getAmbientOcclusionRadius
- Communicator.View.getAmbientOcclusionRadius()
- Return type
number
- Returns
the ambient occlusion radius
getAntiAliasingMode
- Communicator.View.getAntiAliasingMode()
Gets the anti-aliasing mode for the scene. The Default value is AntiAliasingMode.SMAA
- Return type
Communicator.AntiAliasingMode
- Returns
the current anti-aliasing mode.
getBackfacesVisible
- Communicator.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
- Communicator.View.getBackgroundColor()
Returns the background colors of the canvas.
- Return type
Communicator.VerticalGradient
- Returns
the canvas background colors.
getBloomEnabled
- Communicator.View.getBloomEnabled()
Returns whether bloom is enabled.
- Return type
boolean
See
setBloomEnabled
getBloomIntensityScale
- Communicator.View.getBloomIntensityScale()
Gets the intensity of the bloom effect.
- Return type
number
See
setBloomIntensityScale
getBloomLayers
- Communicator.View.getBloomLayers()
Returns an array of objects describing each layer in the bloom effect.
- Return type
[Communicator.BloomLayerInfo]
See
setBloomLayers
getBloomThreshold
- Communicator.View.getBloomThreshold()
Returns the minimum luminance value a pixel must have for it to contribute to bloom.
- Return type
number
See
setBloomThreshold
getBloomThresholdRampWidth
getBloomThresholdRampWidth
- Communicator.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.- Return type
number
See
setBloomThresholdRampWidth
getBoundingCalculationIgnoresInvisible
- Communicator.View.getBoundingCalculationIgnoresInvisible()
- Return type
boolean
- Returns
whether or not bounding calculations by this View object ignores invisible geometry.
getCamera
- Communicator.View.getCamera()
Gets the current camera
- Return type
Communicator.Camera
- Returns
the current camera
getCanvasSize
- Communicator.View.getCanvasSize()
Returns the size of the viewer canvas.
- Return type
Communicator.Point2
- Returns
the current size of the viewer canvas.
getDrawMode
- Communicator.View.getDrawMode()
- Return type
Communicator.DrawMode
- Returns
The current draw mode
getEyeDomeLightingBlurEdgeDistance
- Communicator.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
- Communicator.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
- Communicator.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
- Communicator.View.getEyeDomeLightingEnabled()
- Return type
Promise[boolean]
- Returns
boolean value indicating if eye-dome lighting is enabled or disabled.
getEyeDomeLightingOpacity
- Communicator.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
- Communicator.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
- Communicator.View.getFaceVisibility()
Gets the face visibility for the view.
- Return type
boolean
- Returns
whether faces are currently being drawn.
getFullCameraMatrix
- Communicator.View.getFullCameraMatrix()
This is equivalent to (projectionMatrix * viewMatrix).
- Return type
Communicator.Matrix
- Returns
The current full camera matrix.
getGoochBaseColorProminence
- Communicator.View.getGoochBaseColorProminence()
Gets the prominence of the object’s base color in Gooch shading.
- Return type
number
getGoochBlue
- Communicator.View.getGoochBlue()
Gets the value to use as the blue tone in Gooch shading.
- Return type
number
getGoochLuminanceShiftStrength
- Communicator.View.getGoochLuminanceShiftStrength()
Gets the strength of the luminance shift in Gooch shading.
- Return type
number
getGoochYellow
- Communicator.View.getGoochYellow()
Gets the value to use as the yellow tone in Gooch shading.
- Return type
number
getGroundPlane
- Communicator.View.getGroundPlane()
Returns information about the invisible ground plane onto which simple shadows and reflections are projected.
- Return type
Communicator.GroundPlane
See also: -
setGroundPlane
getHardEdgeColor
- Communicator.View.getHardEdgeColor()
Returns the color of hard edges.
- Return type
Communicator.Color
See also: -
setHardEdgeColor
-setHardEdgesEnabled
getHardEdgeOpacity
- Communicator.View.getHardEdgeOpacity()
Returns the opacity of hard edges.
- Return type
number
See also: -
setHardEdgeOpacity
-setHardEdgesEnabled
getHardEdgeThreshold
- Communicator.View.getHardEdgeThreshold()
Returns the angle threshold for hard edges. Edges will be drawn between two faces whose normals diverge beyond this angle.
- Return type
number
See also: -
setHardEdgeThreshold
-setHardEdgeThresholdRampWidth
-setHardEdgesEnabled
getHardEdgeThresholdRampWidth
- Communicator.View.getHardEdgeThresholdRampWidth()
Returns the value set by
setHardEdgeThresholdRampWidth
- 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
- Communicator.View.getHardEdgesEnabled()
Returns whether hard edges are enabled. Hard edges are edges between two faces whose normals diverge beyond a given angle.
- Return type
boolean
Hard edges are always enabled in hidden line mode, regardless of the return value.
See
setHardEdgesEnabled
getImageBasedLightingEnabled
- Communicator.View.getImageBasedLightingEnabled()
Returns whether image-based lighting is enabled for physically-based materials.
- Return type
boolean
See also: -
setImageBasedLightingEnabled
-setImageBasedLightingIntensity
-setImageBasedLightingOrientation
getImageBasedLightingIntensity
- Communicator.View.getImageBasedLightingIntensity()
Returns the intensity (brightness) of image-based lighting applied to physically-based materials.
- Return type
number
The default value is 1.
See also: -
setImageBasedLightingIntensity
-setImageBasedLightingEnabled
-setImageBasedLightingOrientation
getImageBasedLightingOrientation
- Communicator.View.getImageBasedLightingOrientation()
Returns the orientation of the image-based lighting environment applied to physically-based materials.
- Return type
Communicator.ImageBasedLightingOrientation
See also: -
setImageBasedLightingOrientation
-setImageBasedLightingEnabled
-setImageBasedLightingIntensity
getInteractiveDrawLimitIncreaseEnabled
- Communicator.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
getLightingEnabled
- Communicator.View.getLightingEnabled()
Returns whether lighting is enabled.
- Return type
boolean
See also
setLightingEnabled
getLineJitterEnabled
- Communicator.View.getLineJitterEnabled()
Returns whether line jitter is enabled.
- 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
- Communicator.View.getLineJitterFrequency()
Returns the frequency of the noise used to offset line vertices when line jitter is enabled. The default value is 5.
- Return type
number
See also: -
getLineJitterEnabled
-getLineJitterInstanceCount
-getLineJitterRadius
-setLineJitterFrequency
getLineJitterInstanceCount
- Communicator.View.getLineJitterInstanceCount()
Returns the number of times lines are drawn when line jitter is enabled. The default value is 4.
- Return type
number
See also: -
getLineJitterEnabled
-setLineJitterInstanceCount
-getLineJitterRadius
-getLineJitterFrequency
getLineJitterRadius
- Communicator.View.getLineJitterRadius()
Returns the radius of the random offset applied to line vertices when line jitter is enabled. The default value is 0.005.
- 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
- Communicator.View.getLineVisibility()
Gets the line visibility for the view.
- Return type
boolean
- Returns
whether lines are currently being drawn.
getPointShape
- Communicator.View.getPointShape()
Gets the PointShape. See
PointShape
- Return type
Promise[Communicator.PointShape]
getPointSize
- Communicator.View.getPointSize()
Gets the diameter of rendered points. See
PointSizeUnit
- Return type
Promise[(number, Communicator.PointSizeUnit)]
getProjectionMatrix
- Communicator.View.getProjectionMatrix()
Gets the projection matrix.
- Return type
Communicator.Matrix
- Returns
The current projection matrix.
getProjectionMode
- Communicator.View.getProjectionMode()
Gets the projection mode.
- Return type
Communicator.Projection
- Returns
The current projection mode.
getSilhouetteColor
- Communicator.View.getSilhouetteColor()
Returns the color of silhouette edges.
- Return type
Communicator.Color
See also: -
setSilhouetteColor
-setSilhouetteEnabled
getSilhouetteEnabled
- Communicator.View.getSilhouetteEnabled()
Returns whether silhouette edges are enabled.
- Return type
boolean
Silhouette edges are always enabled in hidden line mode, regardless of the return value.
See
setSilhouetteEnabled
getSilhouetteOpacity
- Communicator.View.getSilhouetteOpacity()
Returns the opacity of silhouette edges.
- Return type
number
See also: -
setSilhouetteOpacity
-setSilhouetteEnabled
getSilhouetteThreshold
- Communicator.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.
- Return type
number
The value is a proportion of the canvas size and not a world-space distance.
See also: -
setSilhouetteThreshold
-setSilhouetteThresholdRampWidth
-setSilhouetteEnabled
getSilhouetteThresholdRampWidth
- Communicator.View.getSilhouetteThresholdRampWidth()
Returns the value set by
setSilhouetteThresholdRampWidth
- 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
- Communicator.View.getSimpleReflectionAttenuation()
Returns properties that control how objects drawn in simple reflections fade as they move further from the ground plane.
- 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
- Communicator.View.getSimpleReflectionBlurInterval()
Returns the distance between samples taken by the blur filter used for simple reflections.
- Return type
(number, Communicator.BlurIntervalUnit)
See also: -
setSimpleReflectionBlurInterval
-setSimpleReflectionEnabled
getSimpleReflectionBlurSamples
- Communicator.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.- Return type
number
See also: -
setSimpleReflectionBlurSamples
-setSimpleReflectionEnabled
getSimpleReflectionEnabled
- Communicator.View.getSimpleReflectionEnabled()
Returns whether simple reflections are enabled.
- Return type
boolean
See
setSimpleReflectionEnabled
getSimpleReflectionFadeAngle
- Communicator.View.getSimpleReflectionFadeAngle()
Returns the angle, in degrees, between the view vector and the ground plane at which simple reflections begin to fade.
- 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
- Communicator.View.getSimpleReflectionOpacity()
Returns the opacity of simple reflections.
- Return type
number
See also: -
setSimpleReflectionOpacity
-setSimpleReflectionEnabled
getSimpleShadowBlurInterval
- Communicator.View.getSimpleShadowBlurInterval()
Returns the distance in pixels between samples taken by the blur filter used for simple shadows.
- Return type
number
See also: -
setSimpleShadowBlurInterval
-setSimpleShadowEnabled
getSimpleShadowBlurSamples
- Communicator.View.getSimpleShadowBlurSamples()
Returns the diameter of the blur filter used for simple shadows.
- Return type
number
See also: -
setSimpleShadowBlurSamples
-setSimpleShadowEnabled
getSimpleShadowColor
- Communicator.View.getSimpleShadowColor()
Returns the color of simple shadows.
- Return type
Communicator.Color
See also: -
setSimpleShadowColor
-setSimpleShadowEnabled
getSimpleShadowEnabled
- Communicator.View.getSimpleShadowEnabled()
Returns whether simple shadows are enabled.
- Return type
boolean
See
setSimpleShadowEnabled
getSimpleShadowInteractiveUpdateEnabled
- Communicator.View.getSimpleShadowInteractiveUpdateEnabled()
Returns whether simple shadows will be updated during user interaction.
- Return type
boolean
See also: -
setSimpleShadowInteractiveUpdateEnabled
-setSimpleShadowEnabled
getSimpleShadowOpacity
- Communicator.View.getSimpleShadowOpacity()
Returns the opacity of simple shadows.
- Return type
number
See also: -
setSimpleShadowOpacity
-setSimpleShadowEnabled
getSimpleShadowResolution
- Communicator.View.getSimpleShadowResolution()
Returns the width and height in pixels of the texture image into which simple shadows are drawn.
- Return type
number
See also: -
getSimpleShadowResolution
-setSimpleShadowEnabled
getToonShadingBandCount
- Communicator.View.getToonShadingBandCount()
Gets the current number of discrete shading bands that will be used when toon shading is enabled.
- Return type
number
getToonShadingSpecularFactor
- Communicator.View.getToonShadingSpecularFactor()
Gets the current toon shading specular scale factor.
- Return type
number
getViewMatrix
- Communicator.View.getViewMatrix()
Gets the view matrix.
- Return type
Communicator.Matrix
- Returns
The current view matrix.
getViewOrientationCamera
- Communicator.View.getViewOrientationCamera(orientation, bounding, preserveModelUp)
Returns a camera set to a ViewOrientation
- Arguments
orientation (
Communicator.ViewOrientation()
) – The desired view orientation for the camera.bounding (
Communicator.Box()
) – Optional bounding to fit the camera about. If not supplied, the model bounding will be used.preserveModelUp (
{ }()
) –
- Return type
Promise[Communicator.Camera]
isolateNodes
- Communicator.View.isolateNodes(nodeIds, duration, fitNodes, initiallyHiddenStayHidden)
Hides all nodes except those specified. Also fits the camera to those nodes’ bounding box.
- Arguments
nodeIds (
[Communicator.NodeId]()
) – An array of the node IDs to be isolated.duration (
{ }()
) – Time in milliseconds for the camera transition to the new camera view.fitNodes (
{ }()
) – If true, then the view is fitted around the isolated nodes.initiallyHiddenStayHidden (
{ }()
) – Controls whether or not initially hidden geometries stay hidden. Default behavior is driven bysetBehaviorInitiallyHidden
- Return type
Promise[void]
pickAllFromPoint
- Communicator.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 (
Communicator.Point2()
) – Canvas position to pick from.config (
Communicator.PickConfig()
) – The configuration object used for this picking operation.
- Return type
Promise[[Communicator.Selection.NodeEntitySelectionItem]]
- Returns
An object containing the result of the picking operation.
pickAllFromRay
- Communicator.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 (
Communicator.Ray()
) – The world-space ray to perform the selection with.config (
Communicator.PickConfig()
) – The configuration object used for this picking operation.
- Return type
Promise[[Communicator.Selection.NodeEntitySelectionItem]]
- Returns
An object containing the result of the picking operation.
pickFromPoint
- Communicator.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 (
Communicator.Point2()
) – Canvas position to pick from.config (
Communicator.PickConfig()
) – The configuration object used for this picking operation.
- Return type
Promise[Communicator.Selection.SelectionItem]
- Returns
An object containing the result of the picking operation.
pickFromRay
- Communicator.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 (
Communicator.Ray()
) – The world-space ray to perform the selection with.config (
Communicator.PickConfig()
) – The configuration object used for this picking operation.
- Return type
Promise[Communicator.Selection.SelectionItem]
- Returns
An object containing the result of the picking operation.
pointToWindowPosition
- Communicator.View.pointToWindowPosition(pt)
Creates a normalized window position in the range of (-1, 1) for a given point in window space.
- Arguments
pt (
Communicator.Point2()
) –
- Return type
Communicator.Point2
- Returns
the normalized window position
projectPoint
- Communicator.View.projectPoint(source, camera)
Projects a 3d world space point to a 3d screen space point.
- Arguments
source (
Communicator.Point3()
) –camera (
Communicator.Camera()
) – if a camera is provided, its projection and view matrix will be used.
- Return type
Communicator.Point3
- Returns
point projected into 3d screen space.
raycastFromPoint
- Communicator.View.raycastFromPoint(point)
Creates a ray based on a viewport position.
- Arguments
point (
Communicator.Point2()
) – The (X, Y) viewport position.
- Return type
{ }
- Returns
The ray if it was generated, otherwise null.
removeLight
- Communicator.View.removeLight(key)
removes a light from the scene. See
Light
- Arguments
key (
Communicator.LightKey()
) –
- Return type
void
See also: -
addLight
-clearLights
-updateLight
resetCamera
- Communicator.View.resetCamera(duration)
Resets the camera to the initial view of the model when first loaded.
- Arguments
duration (
{ }()
) – the amount of time in milliseconds that the camera transition between the current and initial view should take.
- Return type
Promise[void]
setAmbientLightColor
- Communicator.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.
- Arguments
value (
Communicator.Color()
) –
- Return type
void
See also
getAmbientLightColor
setAmbientOcclusionEnabled
- Communicator.View.setAmbientOcclusionEnabled(enabled)
Sets whether ambient occlusion is enabled
- Arguments
enabled (
{ }()
) – sets whether ambient occlusion will be enabled
- Return type
Communicator.DeprecatedPromise
setAmbientOcclusionRadius
- Communicator.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
Communicator.DeprecatedPromise
setAntiAliasingMode
- Communicator.View.setAntiAliasingMode(antiAliasingMode)
Sets the anti-aliasing mode for the scene.
- Arguments
antiAliasingMode (
Communicator.AntiAliasingMode()
) –
- Return type
Communicator.DeprecatedPromise
setBackfacesVisible
- Communicator.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
Communicator.DeprecatedPromise
- Returns
Promise that is resolved when this operation has completed.
setBackgroundColor
- Communicator.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.
- Arguments
top (
{ }()
) – the top color for the the background gradient.bottom (
{ }()
) – the bottom color for the the background gradient.
- Return type
Communicator.DeprecatedPromise
- 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
- Communicator.View.setBloomEnabled(value)
Sets whether bloom is enabled.
- Arguments
value (
{ }()
) –
- Return type
void
See
getBloomEnabled
setBloomIntensityScale
- Communicator.View.setBloomIntensityScale(value)
Sets the intensity of the bloom effect. This value is multiplied by the intensities of the individual layers set by
setBloomLayers
- Arguments
value (
number()
) –
- Return type
void
See
getBloomIntensityScale
setBloomLayers
- Communicator.View.setBloomLayers(layers)
Sets the number of layers in the bloom effect and the layers’ attributes.
- Arguments
layers (
[Communicator.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
- Communicator.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]
.- Arguments
value (
number()
) –
- Return type
void
See
getBloomThreshold
setBloomThresholdRampWidth
setBloomThresholdRampWidth
- Communicator.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.- 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
- Communicator.View.setBoundingCalculationIgnoresInvisible(value)
Sets whether or not bounding calculations by this View object ignores invisible geometry.
- Arguments
value (
boolean()
) –
- Return type
void
setCamera
- Communicator.View.setCamera(camera, duration)
Sets the current camera
- Arguments
camera (
{ }()
) – the camera to setduration (
{ }()
) – camera transition time in milliseconds
- Return type
boolean
setDisplayIncompleteFrames
- Communicator.View.setDisplayIncompleteFrames(value)
Sets whether intermediate frames of an incremental draw will be displayed. (default: true)
- Arguments
value (
boolean()
) –
- Return type
Communicator.DeprecatedPromise
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
- Communicator.View.setDrawMode(drawMode)
Sets the drawing mode for the scene.
- Arguments
drawMode (
Communicator.DrawMode()
) – The drawing mode to set.
- Return type
Communicator.DeprecatedPromise
setEyeDomeLightingBlurEdgeDistance
- Communicator.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
Communicator.DeprecatedPromise
setEyeDomeLightingBlurInterval
- Communicator.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
Communicator.DeprecatedPromise
setEyeDomeLightingBlurSamples
- Communicator.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
Communicator.DeprecatedPromise
setEyeDomeLightingEnabled
- Communicator.View.setEyeDomeLightingEnabled(enabled)
Enables or disables eye-dome lighting for point clouds. (default: disabled)
- Arguments
enabled (
{ }()
) –
- Return type
Communicator.DeprecatedPromise
setEyeDomeLightingOpacity
- Communicator.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
Communicator.DeprecatedPromise
setEyeDomeLightingShadingEdgeDistance
- Communicator.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
Communicator.DeprecatedPromise
setFaceVisibility
- Communicator.View.setFaceVisibility(faceVisibility)
Sets the face visibility for the view.
- Arguments
faceVisibility (
boolean()
) – indicates whether to draw faces.
- Return type
Communicator.DeprecatedPromise
setGoochBaseColorProminence
- Communicator.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
- Communicator.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
- Communicator.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
- Communicator.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
- Communicator.View.setGroundPlane(plane)
Defines the invisible ground plane onto which simple shadows and reflections are projected.
- Arguments
plane (
Communicator.GroundPlane()
) – The plane to set.
- Return type
void
See also: -
getGroundPlane
-setSimpleShadowEnabled
-setSimpleReflectionEnabled
setHardEdgeColor
- Communicator.View.setHardEdgeColor(value)
Sets the color of hard edges.
- Arguments
value (
Communicator.Color()
) – The color to set.
- Return type
void
See also: -
getHardEdgeColor
-setHardEdgesEnabled
setHardEdgeOpacity
- Communicator.View.setHardEdgeOpacity(value)
Sets the opacity of hard edges.
- Arguments
value (
number()
) – The opacity to set.
- Return type
void
See also: -
getHardEdgeOpacity
-setHardEdgesEnabled
setHardEdgeThreshold
- Communicator.View.setHardEdgeThreshold(degrees)
Sets the angle threshold for hard edges. Edges will be drawn between two faces whose normals diverge beyond this angle.
- Arguments
degrees (
number()
) – The threshold to set.
- Return type
void
See also: -
getHardEdgeThreshold
-setHardEdgeThresholdRampWidth
-setHardEdgesEnabled
setHardEdgeThresholdRampWidth
- Communicator.View.setHardEdgeThresholdRampWidth(degrees)
Controls how quickly edges fade as the angle between adjacent faces decreases.
- 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
- Communicator.View.setHardEdgesEnabled(value)
Enables or disables hard edges. Hard edges are edges between two faces whose normals diverge beyond a given angle.
- Arguments
value (
{ }()
) – 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
- Communicator.View.setImageBasedLightingEnabled(value)
Sets whether image-based lighting is enabled for physically-based materials.
- Arguments
value (
boolean()
) –
- Return type
void
See also: -
getImageBasedLightingEnabled
-setImageBasedLightingIntensity
-setImageBasedLightingOrientation
setImageBasedLightingEnvironment
- Communicator.View.setImageBasedLightingEnvironment(data)
Sets the environment image used by image-based lighting applied to physically-based materials.
- Arguments
data (
{ }()
) –
- 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
- Communicator.View.setImageBasedLightingIntensity(value)
Sets the intensity (brightness) of image-based lighting applied to physically-based materials.
- Arguments
value (
number()
) –
- Return type
void
The default value is 1.
See also: -
getImageBasedLightingIntensity
-setImageBasedLightingEnabled
-setImageBasedLightingOrientation
setImageBasedLightingOrientation
- Communicator.View.setImageBasedLightingOrientation(value)
Sets the orientation of the image-based lighting environment applied to physically-based materials.
- Arguments
- Return type
void
See also: -
getImageBasedLightingOrientation
-setImageBasedLightingEnabled
-setImageBasedLightingIntensity
setInitialCamera
- Communicator.View.setInitialCamera(camera)
Sets the camera that will be used for the initial camera view.
- Arguments
camera (
Communicator.Camera()
) –
- Return type
void
setInteractiveDrawDelay
- Communicator.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
Communicator.DeprecatedPromise
setInteractiveDrawLimitIncreaseEnabled
- Communicator.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
- Communicator.View.setLightingEnabled(enabled)
Sets whether lighting is enabled. When disabled, material colors are drawn at full intensity.
- Arguments
enabled (
{ }()
) –
- Return type
Communicator.DeprecatedPromise
See also
InstanceModifier.DoNotLight
clearLights
setLineJitterEnabled
- Communicator.View.setLineJitterEnabled(value)
Sets whether line jitter is enabled.
- Arguments
value (
{ }()
) –
- 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
- Communicator.View.setLineJitterFrequency(value)
Sets the frequency of the noise used to offset line vertices when line jitter is enabled. The default value is 5.
- 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
- Communicator.View.setLineJitterInstanceCount(value)
Sets the number of times lines are drawn when line jitter is enabled. The default value is 4.
- Arguments
value (
number()
) –
- Return type
void
Increasing this number can make the lines look more ‘sketchy.’
See also: -
setLineJitterEnabled
-getLineJitterInstanceCount
-setLineJitterRadius
-setLineJitterFrequency
setLineJitterRadius
- Communicator.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.
- 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
- Communicator.View.setLineVisibility(lineVisibility)
Sets the line visibility for the view.
- Arguments
lineVisibility (
boolean()
) – indicates whether to draw lines.
- Return type
Communicator.DeprecatedPromise
setPointShape
- Communicator.View.setPointShape(shape)
Controls the appearance of rendered points. (default: Square) See
PointShape
- Arguments
shape (
Communicator.PointShape()
) –
- Return type
Communicator.DeprecatedPromise
setPointSize
- Communicator.View.setPointSize(size, unit)
Sets the diameter of rendered points. (default: 1, ScreenPixels) See
PointSizeUnit
- Arguments
size (
number()
) –unit (
Communicator.PointSizeUnit()
) –
- Return type
Communicator.DeprecatedPromise
setPointVisibilityTest
- Communicator.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.
- Arguments
points (
[Communicator.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
- Communicator.View.setProjectionMode(projectionMode)
Sets the projection mode.
- Arguments
projectionMode (
Communicator.Projection()
) –
- Return type
void
setSilhouetteColor
- Communicator.View.setSilhouetteColor(value)
Sets the color of silhouette edges.
- Arguments
value (
Communicator.Color()
) – The color to set.
- Return type
void
See also: -
getSilhouetteColor
-setSilhouetteEnabled
setSilhouetteEnabled
- Communicator.View.setSilhouetteEnabled(value)
Enables or disables silhouette edges.
- Arguments
value (
{ }()
) – 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
- Communicator.View.setSilhouetteOpacity(value)
Sets the opacity of silhouette edges.
- Arguments
value (
number()
) – The opacity to set.
- Return type
void
See also: -
getSilhouetteOpacity
-setSilhouetteEnabled
setSilhouetteThreshold
- Communicator.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.
- 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
- Communicator.View.setSilhouetteThresholdRampWidth(value)
Controls how quickly edges fade as z-distance between pixels decreases.
- 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
- Communicator.View.setSimpleReflectionAttenuation(nearDistance, farDistance, unit)
Controls how objects drawn in simple reflections fade as they move further from the ground plane.
- 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 (
Communicator.SimpleReflectionAttenuationUnit()
) – The unit in whichnearDistance
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
- Communicator.View.setSimpleReflectionBlurInterval(value, unit)
Sets the distance between samples taken by the blur filter used for simple reflections.
- Arguments
value (
number()
) – The interval to set.unit (
Communicator.BlurIntervalUnit()
) – The unit in which thevalue
argument is specified.
- Return type
void
See also: -
getSimpleReflectionBlurInterval
-setSimpleReflectionEnabled
setSimpleReflectionBlurSamples
- Communicator.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.- Arguments
value (
number()
) –
- Return type
void
See also: -
getSimpleReflectionBlurSamples
-setSimpleReflectionEnabled
setSimpleReflectionEnabled
- Communicator.View.setSimpleReflectionEnabled(value)
Enables or disables simple reflections projected onto an invisible ground plane.
- Arguments
value (
{ }()
) –
- Return type
void
See also: -
getSimpleReflectionEnabled
-setSimpleReflectionOpacity
-setSimpleReflectionBlurSamples
-setSimpleReflectionBlurInterval
-setSimpleReflectionFadeAngle
setSimpleReflectionFadeAngle
- Communicator.View.setSimpleReflectionFadeAngle(degrees)
Sets the angle, in degrees, between the view vector and the ground plane at which simple reflections begin to fade.
- 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
- Communicator.View.setSimpleReflectionOpacity(value)
Sets the opacity of simple reflections.
- Arguments
value (
number()
) –
- Return type
void
See also: -
getSimpleReflectionOpacity
-setSimpleReflectionEnabled
setSimpleShadowBlurInterval
- Communicator.View.setSimpleShadowBlurInterval(value)
Sets the distance in pixels between samples taken by the blur filter used for simple shadows.
- Arguments
value (
number()
) – The interval to set.
- Return type
void
See also: -
getSimpleShadowBlurInterval
-setSimpleShadowEnabled
setSimpleShadowBlurSamples
- Communicator.View.setSimpleShadowBlurSamples(value)
Sets the diameter of the blur filter used for simple shadows. Setting the value to
0
will disable blurring.- Arguments
value (
number()
) – The number of samples.
- Return type
void
See also: -
getSimpleShadowBlurSamples
-setSimpleShadowEnabled
setSimpleShadowColor
- Communicator.View.setSimpleShadowColor(color)
Sets the color of simple shadows.
- Arguments
color (
Communicator.Color()
) – The color to set.
- Return type
void
See also: -
getSimpleShadowColor
-setSimpleShadowEnabled
setSimpleShadowEnabled
- Communicator.View.setSimpleShadowEnabled(value)
Enables or disables a full-scene shadow projected onto an invisible ground plane.
- Arguments
value (
{ }()
) – Whether simple shadows should be enabled.
- Return type
void
See also: -
getSimpleShadowEnabled
-setSimpleShadowColor
-setSimpleShadowOpacity
-setGroundPlane
-setSimpleShadowResolution
-setSimpleShadowInteractiveUpdateEnabled
setSimpleShadowInteractiveUpdateEnabled
- Communicator.View.setSimpleShadowInteractiveUpdateEnabled(value)
Enables or disables updates to simple shadows during user interaction.
- Arguments
value (
{ }()
) –
- Return type
void
See also: -
getSimpleShadowInteractiveUpdateEnabled
-setSimpleShadowEnabled
setSimpleShadowOpacity
- Communicator.View.setSimpleShadowOpacity(opacity)
Sets the opacity of simple shadows.
- Arguments
opacity (
number()
) – The opacity to set.
- Return type
void
See also: -
getSimpleShadowOpacity
-setSimpleShadowEnabled
setSimpleShadowResolution
- Communicator.View.setSimpleShadowResolution(pixels)
Sets the width and height in pixels of the texture image into which simple shadows are drawn.
- Arguments
pixels (
number()
) – The resolution to set.
- Return type
void
See also: -
getSimpleShadowResolution
-setSimpleShadowEnabled
setStatisticsDisplayVisibility
- Communicator.View.setStatisticsDisplayVisibility(visibility)
Sets the display for the default statistic overlay.
- Arguments
visibility (
boolean()
) –
- Return type
Promise[void]
setToonShadingBandCount
- Communicator.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
- Communicator.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
- Communicator.View.setTransparencyMode(mode)
Sets how transparent objects are blended.
- Arguments
mode (
Communicator.TransparencyMode()
) –
- Return type
void
setViewOrientation
- Communicator.View.setViewOrientation(orientation, duration, bounding, preserveModelUp)
Sets the view to a standard orientation.
- Arguments
orientation (
Communicator.ViewOrientation()
) – The desired view orientation for the camera.duration (
{ }()
) – The number of milliseconds used to transition to the new camera.bounding (
Communicator.Box()
) – Optional bounding to fit the camera about. If not supplied, the model bounding will be used.preserveModelUp (
{ }()
) – Indicates whether the camera up will be set according to model up or current camera.
- Return type
Promise[void]
setXRayColor
- Communicator.View.setXRayColor(element, color, group)
Sets the color applied to nodes in x-ray mode. By default, the color is unset.
- Arguments
element (
Communicator.ElementType()
) – the type of geometry to apply the color tocolor (
Communicator.Color()
) – the color to applygroup (
Communicator.XRayGroup()
) – the category of nodes that will be affected. If unspecified,XRayGroup.Selected
will be used.
- Return type
Communicator.DeprecatedPromise
See
unsetXRayColor
setXRayOpacity
- Communicator.View.setXRayOpacity(opacity, element)
Sets the opacity of unselected items in x-ray mode.
- Arguments
opacity (
number()
) – a number between 0 and 1element (
Communicator.ElementType()
) – the type of element to which the opacity will apply. If unspecified, the opacity will apply to all element types.
- Return type
Communicator.DeprecatedPromise
setXRayTransparencyMode
- Communicator.View.setXRayTransparencyMode(mode)
Sets how transparent (unselected) objects are blended in x-ray mode.
- Arguments
mode (
Communicator.XRayTransparencyMode()
) –
- Return type
Communicator.DeprecatedPromise
startComparison
- Communicator.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.- Arguments
nodeIdSet1 (
[Communicator.NodeId]()
) – the nodes to compare againstnodeIdSet2
nodeIdSet2 (
[Communicator.NodeId]()
) – the nodes to compare againstnodeIdSet1
config (
Communicator.ComparisonConfig()
) – settings controlling the behavior of the comparison
- Return type
void
See
endComparison
testPointVisibility
- Communicator.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.
- Arguments
points (
[Communicator.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
- Communicator.View.unprojectPoint(point, z)
Unprojects a 2d screen space point to a 3d world space point.
- Arguments
point (
Communicator.Point2()
) – 2d screen spacez (
number()
) – z value, default 0
- Return type
{ }
- Returns
point world space point
unsetXRayColor
- Communicator.View.unsetXRayColor(element, group)
Unsets the color applied to selected items in x-ray mode. Selected items will be displayed without overriding their colors.
- Arguments
element (
Communicator.ElementType()
) – the type of geometry affected by the changegroup (
Communicator.XRayGroup()
) – the category of nodes that will be affected. If unspecified,XRayGroup.Selected
will be used.
- Return type
Promise[void]
See
setXRayColor
updateCamera
- Communicator.View.updateCamera(camera)
Updates camera properties individually. This method should be used to incrementally update camera properties individually.
- Arguments
camera (
Communicator.Camera()
) – the camera to set.
- Return type
Communicator.Camera
- Returns
updated camera object.
updateLight
- Communicator.View.updateLight(key, light)
Updates a light in the scene. See
Light
- Arguments
key (
Communicator.LightKey()
) –light (
Communicator.Light()
) –
- Return type
void
See also: -
addLight
-clearLights
-removeLight