View
-
class
View() Index
Properties
Accessors
Methods
addLightadvanceIncrementalSelectionbeginConvexPolyhedronSelectionbeginRayDrillSelectionbeginScreenSelectByAreabeginSphereSelectioncenterCameraOnNodeclearLightscompositePickFromPointendComparisonendIncrementalSelectionfitBoundingfitNodesfitWorldgetAmbientLightColorgetAmbientOcclusionEnabledgetAmbientOcclusionRadiusgetAntiAliasingModegetAxisTriadgetBackfacesVisiblegetBackgroundColorgetBloomEnabledgetBloomIntensityScalegetBloomLayersgetBloomThresholdgetBloomThresholdRampWidthgetBoundingCalculationIgnoresInvisiblegetCameragetCanvasSizegetDrawModegetDrawStrategygetEyeDomeLightingBlurEdgeDistancegetEyeDomeLightingBlurIntervalgetEyeDomeLightingBlurSamplesgetEyeDomeLightingEnabledgetEyeDomeLightingOpacitygetEyeDomeLightingShadingEdgeDistancegetFaceVisibilitygetFullCameraMatrixgetGoochBaseColorProminencegetGoochBluegetGoochLuminanceShiftStrengthgetGoochYellowgetGroundPlanegetHardEdgeColorgetHardEdgeOpacitygetHardEdgesEnabledgetHardEdgeThresholdgetHardEdgeThresholdRampWidthgetHiddenLineSettingsgetImageBasedLightingEnabledgetImageBasedLightingIntensitygetImageBasedLightingOrientationgetInteractiveDrawLimitIncreaseEnabledgetLightgetLightingEnabledgetLightKeysgetLineJitterEnabledgetLineJitterFrequencygetLineJitterInstanceCountgetLineJitterRadiusgetLineVisibilitygetMassageExtremeCamerasgetNavCubegetPointShapegetPointSizegetProjectionMatrixgetProjectionModegetSilhouetteColorgetSilhouetteEnabledgetSilhouetteOpacitygetSilhouetteThresholdgetSilhouetteThresholdRampWidthgetSimpleReflectionAttenuationgetSimpleReflectionBlurIntervalgetSimpleReflectionBlurSamplesgetSimpleReflectionEnabledgetSimpleReflectionFadeAnglegetSimpleReflectionOpacitygetSimpleShadowBlurIntervalgetSimpleShadowBlurSamplesgetSimpleShadowColorgetSimpleShadowEnabledgetSimpleShadowInteractiveUpdateEnabledgetSimpleShadowOpacitygetSimpleShadowResolutiongetToonShadingBandCountgetToonShadingSpecularFactorgetViewMatrixgetViewOrientationCamerainjectViewOrientationChangeEventisolateNodespickAllFromPointpickAllFromRaypickFromPointpickFromRaypointToWindowPositionprojectPointraycastFromPointredrawremoveLightresetCamerasetAmbientLightColorsetAmbientOcclusionEnabledsetAmbientOcclusionRadiussetAntiAliasingModesetBackfacesVisiblesetBackgroundColorsetBloomEnabledsetBloomIntensityScalesetBloomLayerssetBloomThresholdsetBloomThresholdRampWidthsetBoundingCalculationIgnoresInvisiblesetCamerasetDisplayIncompleteFramessetDrawModesetEyeDomeLightingBlurEdgeDistancesetEyeDomeLightingBlurIntervalsetEyeDomeLightingBlurSamplessetEyeDomeLightingEnabledsetEyeDomeLightingOpacitysetEyeDomeLightingShadingEdgeDistancesetFaceVisibilitysetGoochBaseColorProminencesetGoochBluesetGoochLuminanceShiftStrengthsetGoochYellowsetGroundPlanesetHardEdgeColorsetHardEdgeOpacitysetHardEdgesEnabledsetHardEdgeThresholdsetHardEdgeThresholdRampWidthsetImageBasedLightingEnabledsetImageBasedLightingEnvironmentsetImageBasedLightingIntensitysetImageBasedLightingOrientationsetInitialCamerasetInteractiveDrawDelaysetInteractiveDrawLimitIncreaseEnabledsetLightingEnabledsetLineJitterEnabledsetLineJitterFrequencysetLineJitterInstanceCountsetLineJitterRadiussetLineVisibilitysetMassageExtremeCamerassetMinimumFrameratesetPointShapesetPointSizesetPointVisibilityTestsetProjectionModesetSilhouetteColorsetSilhouetteEnabledsetSilhouetteOpacitysetSilhouetteThresholdsetSilhouetteThresholdRampWidthsetSimpleReflectionAttenuationsetSimpleReflectionBlurIntervalsetSimpleReflectionBlurSamplessetSimpleReflectionEnabledsetSimpleReflectionFadeAnglesetSimpleReflectionOpacitysetSimpleShadowBlurIntervalsetSimpleShadowBlurSamplessetSimpleShadowColorsetSimpleShadowEnabledsetSimpleShadowInteractiveUpdateEnabledsetSimpleShadowOpacitysetSimpleShadowResolutionsetStatisticsDisplayVisibilitysetToonShadingBandCountsetToonShadingSpecularFactorsetTransparencyModesetViewOrientationsetXRayColorsetXRayOpacitysetXRayTransparencyModestartComparisontestPointVisibilityunprojectPointunsetDefaultCameraunsetXRayColorupdateCameraupdateLight
Properties
-
View.domElements readonly
domElements: DomElements
-
View.floorplanManager readonly
floorplanManager:FloorplanManager
-
View.operatorManager readonly
operatorManager:OperatorManager
-
View.overlayManager readonly
overlayManager:OverlayManager
Accessors
-
View.id() - get id(): number
Returns: number
-
View.inputMonitor() - get inputMonitor(): InputMonitor
Returns: InputMonitor
Methods
-
View.addLight() - addLight(light:
Light): PromiseAdds 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]]
Parameters
light:LightReturns: Promise
-
View.advanceIncrementalSelection() - advanceIncrementalSelection(handle:
IncrementalSelectionId): PromiseReturns the next batch of geometry selected by the supplied selection context.
Parameters
handle:
IncrementalSelectionIdThe handle to an active area selection context.Returns: Promise
Returns selected items. If the resulting list is null then there are no more items to select.
-
View.beginConvexPolyhedronSelection() - beginConvexPolyhedronSelection(volumePlanes:
Plane[], heuristicOrigin:Point3, config:IncrementalPickConfig): PromiseCreates a new and active selection context for the provided selection volume. The selection volume is a convex polyhedron defined by the bounded intersection of its half-spaces.
Parameters
volumePlanes:
Plane[]The planes used to define volume. A point p is inside the volume if and only if (plane.determineSide(p) == true) for all supplied planes.heuristicOrigin:
Point3A point used to compute distances against for prioritizing returned results. This is typically (but not necessarily) the center of the volume.config:
IncrementalPickConfigThe configuration object used for this selection operation.Returns: Promise
The handle for the selection context.
-
View.beginRayDrillSelection() - beginRayDrillSelection(rayCssOrigin:
Point2, rayCssBoxRadius: number, config:IncrementalPickConfig): PromiseCreates 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
SelectionResults returned by advancing a ray drill selection will not have selection positions, since they were not selected at a single point.Parameters
rayCssOrigin:
Point2The 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:
IncrementalPickConfigThe configuration object used for this selection operation.Returns: Promise
The handle for the selection context.
-
View.beginScreenSelectByArea() - beginScreenSelectByArea(areaCssMin:
Point2, areaCssMax:Point2, config:IncrementalPickConfig): PromiseCreates a new and active selection context for the provided selection window.
Parameters
areaCssMin:
Point2The minimum coodinate in CSS pixel space for the selection window.areaCssMax:
Point2The maximum coodinate in CSS pixel space for the selection window.config:
IncrementalPickConfigThe configuration object used for this selection operation.Returns: Promise
The handle for the selection context.
-
View.beginSphereSelection() - beginSphereSelection(sphereCenter:
Point3, sphereRadius: number, config:IncrementalPickConfig): PromiseCreates a new and active selection context for the provided selection sphere.
Parameters
sphereCenter:
Point3The center of the selection sphere.sphereRadius: number
The radius of the selection sphere.config:
IncrementalPickConfigThe configuration object used for this selection operation.Returns: Promise
The handle for the selection context.
-
View.centerCameraOnNode() - centerCameraOnNode(nodeId: number, duration: number?, camera:
Camera?): PromiseCenters the camera on a specified node id.
Parameters
nodeId: number
duration: number = 0
the number of milliseconds to transition to the new camera.camera:
Camera= …Returns: Promise
-
View.clearLights() - clearLights(): void
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]]
Returns: void
-
View.compositePickFromPoint() - compositePickFromPoint(point:
Point2, config:PickConfig): PromisePerforms a composite picking operation. This operation will return all candidate Node entities according to the PickConfig.
Parameters
point:
Point2Canvas position to pick from.config:
PickConfigThe configuration object used for this picking operation.Returns: Promise
An object containing the result of the picking operation.
-
View.endComparison() - endComparison(): void
Disables a visual comparison of two sets of nodes enabled by [[startComparison]].
Returns: void
-
View.endIncrementalSelection() - endIncrementalSelection(handle:
IncrementalSelectionId): PromiseDeactivates and destroys the provided selection context.
Parameters
handle:
IncrementalSelectionIdThe selection context to destroy.Returns: Promise
-
View.fitBounding() -
Fits the camera to the bounding box.
Parameters
Returns: Promise
A promise that will be resolved once the transition is complete.
-
View.fitNodes() - fitNodes(ids: number[], duration: number?): Promise
Fits the camera to the bounding box containing the node ids.
Parameters
ids: number[]
duration: number = DefaultTransitionDuration
Time in milliseconds for the camera transition to the new camera view.Returns: Promise
A promise that will be resolved once the transition is complete.
-
View.fitWorld() - fitWorld(duration: number?, camera:
Camera): PromiseFits the view to the model bounding box.
Parameters
Returns: Promise
A promise that will be resolved once the transition is complete.
-
View.getAmbientLightColor() - getAmbientLightColor():
ColorGets the color of the ambient light applied to the scene.
See also [[setAmbientLightColor]].
Returns:
Color
-
View.getAmbientOcclusionEnabled() - getAmbientOcclusionEnabled(): boolean
Returns: boolean
boolean value indicating whether ambient occlusion is enabled
-
View.getAmbientOcclusionRadius() - getAmbientOcclusionRadius(): number
Returns: number
the ambient occlusion radius
-
View.getAntiAliasingMode() - getAntiAliasingMode():
AntiAliasingModeGets the anti-aliasing mode for the scene. The Default value is AntiAliasingMode.SMAA
Returns:
AntiAliasingModethe current anti-aliasing mode.
-
View.getBackfacesVisible() - getBackfacesVisible(): boolean
Gets whether backfaces are being rendered in the scene.
Returns: boolean
Boolean value indicating whether backfaces are being rendered in the scene.
-
View.getBackgroundColor() - getBackgroundColor():
VerticalGradientReturns the background colors of the canvas.
Returns:
VerticalGradientthe canvas background colors.
-
View.getBloomEnabled() - getBloomEnabled(): boolean
Returns whether bloom is enabled.
See [[setBloomEnabled]].
Returns: boolean
-
View.getBloomIntensityScale() - getBloomIntensityScale(): number
Gets the intensity of the bloom effect.
See [[setBloomIntensityScale]].
Returns: number
-
View.getBloomLayers() - getBloomLayers():
BloomLayerInfo[]Returns an array of objects describing each layer in the bloom effect.
See [[setBloomLayers]].
Returns:
BloomLayerInfo[]
-
View.getBloomThreshold() - getBloomThreshold(): number
Returns the minimum luminance value a pixel must have for it to contribute to bloom.
See [[setBloomThreshold]], [[getBloomThresholdRampWidth]].
Returns: number
-
View.getBloomThresholdRampWidth() - getBloomThresholdRampWidth(): number
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]].
Returns: number
-
View.getBoundingCalculationIgnoresInvisible() - getBoundingCalculationIgnoresInvisible(): boolean
Returns: boolean
whether or not bounding calculations by this View object ignores invisible geometry.
-
View.getCanvasSize() - getCanvasSize():
Point2Returns the size of the viewer canvas.
Returns:
Point2the current size of the viewer canvas.
-
View.getDrawStrategy() - getDrawStrategy():
DrawStrategyGets the draw strategy.
Returns:
DrawStrategyThe current draw strategy.
-
View.getEyeDomeLightingBlurEdgeDistance() - getEyeDomeLightingBlurEdgeDistance(): Promise
Returns a value that controls the maximum Z-distance between samples taken by the blur filter used in eye-dome lighting for point clouds. The value is a proportion of the screen size.
Returns: Promise
-
View.getEyeDomeLightingBlurInterval() - getEyeDomeLightingBlurInterval(): Promise
Returns the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds.
Returns: Promise
-
View.getEyeDomeLightingBlurSamples() - getEyeDomeLightingBlurSamples(): Promise
Returns the diameter of the blur filter used in eye-dome lighting for point clouds. A value of 0 means that blurring is disabled.
Returns: Promise
-
View.getEyeDomeLightingEnabled() - getEyeDomeLightingEnabled(): Promise
Returns: Promise
boolean value indicating if eye-dome lighting is enabled or disabled.
-
View.getEyeDomeLightingOpacity() - getEyeDomeLightingOpacity(): Promise
Returns the opacity of the shading rendered by eye-dome lighting for point clouds. The value is in the range [0,1].
Returns: Promise
-
View.getEyeDomeLightingShadingEdgeDistance() - getEyeDomeLightingShadingEdgeDistance(): Promise
Returns a value that controls the shading contrast in eye-dome lighting for point clouds. The value is a number of pixels.
Returns: Promise
-
View.getFaceVisibility() - getFaceVisibility(): boolean
Gets the face visibility for the view.
Returns: boolean
whether faces are currently being drawn.
-
View.getFullCameraMatrix() - getFullCameraMatrix():
MatrixThis is equivalent to (projectionMatrix * viewMatrix).
Returns:
MatrixThe current full camera matrix.
-
View.getGoochBaseColorProminence() - getGoochBaseColorProminence(): number
Gets the prominence of the object’s base color in Gooch shading.
Returns: number
-
View.getGoochBlue() - getGoochBlue(): number
Gets the value to use as the blue tone in Gooch shading.
Returns: number
-
View.getGoochLuminanceShiftStrength() - getGoochLuminanceShiftStrength(): number
Gets the strength of the luminance shift in Gooch shading.
Returns: number
-
View.getGoochYellow() - getGoochYellow(): number
Gets the value to use as the yellow tone in Gooch shading.
Returns: number
-
View.getGroundPlane() - getGroundPlane():
GroundPlaneReturns information about the invisible ground plane onto which simple shadows and reflections are projected.
See also:
- [[setGroundPlane]]
Returns:
GroundPlane
-
View.getHardEdgeColor() - getHardEdgeColor():
ColorReturns the color of hard edges.
See also:
- [[setHardEdgeColor]]
- [[setHardEdgesEnabled]]
Returns:
Color
-
View.getHardEdgeOpacity() - getHardEdgeOpacity(): number
Returns the opacity of hard edges.
See also:
- [[setHardEdgeOpacity]]
- [[setHardEdgesEnabled]]
Returns: number
-
View.getHardEdgesEnabled() - getHardEdgesEnabled(): boolean
Returns whether hard edges are enabled. Hard edges are edges between two faces whose normals diverge beyond a given angle.
Hard edges are always enabled in hidden line mode, regardless of the return value.
See [[setHardEdgesEnabled]].
Returns: boolean
-
View.getHardEdgeThreshold() - getHardEdgeThreshold(): number
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]]
Returns: number
-
View.getHardEdgeThresholdRampWidth() - getHardEdgeThresholdRampWidth(): number
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
0means that all edges are drawn at full opacity.See also:
- [[setHardEdgeThresholdRampWidth]]
- [[setHardEdgesEnabled]]
Returns: number
-
View.getHiddenLineSettings() - getHiddenLineSettings(): HiddenLineSettings
Returns: HiddenLineSettings
a [[HiddenLineSettings]] object.
-
View.getImageBasedLightingEnabled() - getImageBasedLightingEnabled(): boolean
Returns whether image-based lighting is enabled for physically-based materials.
See also:
- [[setImageBasedLightingEnabled]]
- [[setImageBasedLightingIntensity]]
- [[setImageBasedLightingOrientation]]
Returns: boolean
-
View.getImageBasedLightingIntensity() - getImageBasedLightingIntensity(): number
Returns the intensity (brightness) of image-based lighting applied to physically-based materials.
The default value is 1.
See also:
- [[setImageBasedLightingIntensity]]
- [[setImageBasedLightingEnabled]]
- [[setImageBasedLightingOrientation]]
Returns: number
-
View.getImageBasedLightingOrientation() - getImageBasedLightingOrientation():
ImageBasedLightingOrientationReturns the orientation of the image-based lighting environment applied to physically-based materials.
See also:
- [[setImageBasedLightingOrientation]]
- [[setImageBasedLightingEnabled]]
- [[setImageBasedLightingIntensity]]
Returns:
ImageBasedLightingOrientation
-
View.getInteractiveDrawLimitIncreaseEnabled() - getInteractiveDrawLimitIncreaseEnabled(): Promise
Gets whether or not the viewer will periodically attempt to increase the amount drawn during interaction.
Returns: Promise
boolean value indicating whether this feature is enabled or not
-
View.getLight() - getLight(key:
LightKey): PromiseGet a Light given its key if it exists.
Parameters
key:
LightKeyThe key of the light to get.Returns: Promise
A Light given its key if it exists.
-
View.getLightingEnabled() - getLightingEnabled(): boolean
Returns whether lighting is enabled.
See also [[setLightingEnabled]].
Returns: boolean
-
View.getLightKeys() - getLightKeys(): Promise
Get the list of light keys in the scene.
Returns: Promise
The list of light keys in the scene.
-
View.getLineJitterEnabled() - getLineJitterEnabled(): boolean
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]]
Returns: boolean
-
View.getLineJitterFrequency() - getLineJitterFrequency(): number
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]]
Returns: number
-
View.getLineJitterInstanceCount() - getLineJitterInstanceCount(): number
Returns the number of times lines are drawn when line jitter is enabled. The default value is 4.
See also:
- [[getLineJitterEnabled]]
- [[setLineJitterInstanceCount]]
- [[getLineJitterRadius]]
- [[getLineJitterFrequency]]
Returns: number
-
View.getLineJitterRadius() - getLineJitterRadius(): number
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]]
Returns: number
-
View.getLineVisibility() - getLineVisibility(): boolean
Gets the line visibility for the view.
Returns: boolean
whether lines are currently being drawn.
-
View.getMassageExtremeCameras() - getMassageExtremeCameras(): boolean
Returns: boolean
-
View.getPointShape() - getPointShape(): Promise
Gets the PointShape. See [[PointShape]]
Returns: Promise
-
View.getPointSize() - getPointSize(): Promise
Gets the diameter of rendered points. See [[PointSizeUnit]].
Returns: Promise
-
View.getProjectionMatrix() - getProjectionMatrix():
MatrixGets the projection matrix.
Returns:
MatrixThe current projection matrix.
-
View.getProjectionMode() - getProjectionMode():
ProjectionGets the projection mode.
Returns:
ProjectionThe current projection mode.
-
View.getSilhouetteColor() - getSilhouetteColor():
ColorReturns the color of silhouette edges.
See also:
- [[setSilhouetteColor]]
- [[setSilhouetteEnabled]]
Returns:
Color
-
View.getSilhouetteEnabled() - getSilhouetteEnabled(): boolean
Returns whether silhouette edges are enabled.
Silhouette edges are always enabled in hidden line mode, regardless of the return value.
See [[setSilhouetteEnabled]].
Returns: boolean
-
View.getSilhouetteOpacity() - getSilhouetteOpacity(): number
Returns the opacity of silhouette edges.
See also:
- [[setSilhouetteOpacity]]
- [[setSilhouetteEnabled]]
Returns: number
-
View.getSilhouetteThreshold() - getSilhouetteThreshold(): number
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]]
Returns: number
-
View.getSilhouetteThresholdRampWidth() - getSilhouetteThresholdRampWidth(): number
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
0means that all edges are drawn at full opacity.See also:
- [[setSilhouetteThresholdRampWidth]]
- [[setSilhouetteEnabled]]
Returns: number
-
View.getSimpleReflectionAttenuation() - getSimpleReflectionAttenuation(): { farDistance: number, nearDistance: number, unit:
SimpleReflectionAttenuationUnit}Returns properties that control how objects drawn in simple reflections fade as they move further from the ground plane.
Attenuation begins at
nearDistanceand increases linearly such that the model is not visible in the reflection beyondfarDistance.Attenuation is disabled if
farDistanceis less than or equal tonearDistance.See also:
- [[setSimpleReflectionAttenuation]]
- [[setSimpleReflectionEnabled]]
Returns: { farDistance: number, nearDistance: number, unit:
SimpleReflectionAttenuationUnit}An object with the following properties:
-
View.getSimpleReflectionBlurInterval() - getSimpleReflectionBlurInterval(): [number,
BlurIntervalUnit]Returns the distance between samples taken by the blur filter used for simple reflections.
See also:
- [[setSimpleReflectionBlurInterval]]
- [[setSimpleReflectionEnabled]]
Returns: [number,
BlurIntervalUnit]
-
View.getSimpleReflectionBlurSamples() - getSimpleReflectionBlurSamples(): number
Returns the diameter of the blur filter used for simple reflections. A value less than or equal to
1means that blurring is disabled.See also:
- [[setSimpleReflectionBlurSamples]]
- [[setSimpleReflectionEnabled]]
Returns: number
-
View.getSimpleReflectionEnabled() - getSimpleReflectionEnabled(): boolean
Returns whether simple reflections are enabled.
See [[setSimpleReflectionEnabled]].
Returns: boolean
-
View.getSimpleReflectionFadeAngle() - getSimpleReflectionFadeAngle(): number
Returns the angle, in degrees, between the view vector and the ground plane at which simple reflections begin to fade.
A value to
0means 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]]
Returns: number
-
View.getSimpleReflectionOpacity() - getSimpleReflectionOpacity(): number
Returns the opacity of simple reflections.
See also:
- [[setSimpleReflectionOpacity]]
- [[setSimpleReflectionEnabled]]
Returns: number
-
View.getSimpleShadowBlurInterval() - getSimpleShadowBlurInterval(): number
Returns the distance in pixels between samples taken by the blur filter used for simple shadows.
See also:
- [[setSimpleShadowBlurInterval]]
- [[setSimpleShadowEnabled]]
Returns: number
-
View.getSimpleShadowBlurSamples() - getSimpleShadowBlurSamples(): number
Returns the diameter of the blur filter used for simple shadows.
See also:
- [[setSimpleShadowBlurSamples]]
- [[setSimpleShadowEnabled]]
Returns: number
-
View.getSimpleShadowColor() - getSimpleShadowColor():
ColorReturns the color of simple shadows.
See also:
- [[setSimpleShadowColor]]
- [[setSimpleShadowEnabled]]
Returns:
Color
-
View.getSimpleShadowEnabled() - getSimpleShadowEnabled(): boolean
Returns whether simple shadows are enabled.
See [[setSimpleShadowEnabled]].
Returns: boolean
-
View.getSimpleShadowInteractiveUpdateEnabled() - getSimpleShadowInteractiveUpdateEnabled(): boolean
Returns whether simple shadows will be updated during user interaction.
See also:
- [[setSimpleShadowInteractiveUpdateEnabled]]
- [[setSimpleShadowEnabled]]
Returns: boolean
-
View.getSimpleShadowOpacity() - getSimpleShadowOpacity(): number
Returns the opacity of simple shadows.
See also:
- [[setSimpleShadowOpacity]]
- [[setSimpleShadowEnabled]]
Returns: number
-
View.getSimpleShadowResolution() - getSimpleShadowResolution(): number
Returns the width and height in pixels of the texture image into which simple shadows are drawn.
See also:
- [[getSimpleShadowResolution]]
- [[setSimpleShadowEnabled]]
Returns: number
-
View.getToonShadingBandCount() - getToonShadingBandCount(): number
Gets the current number of discrete shading bands that will be used when toon shading is enabled.
Returns: number
-
View.getToonShadingSpecularFactor() - getToonShadingSpecularFactor(): number
Gets the current toon shading specular scale factor.
Returns: number
-
View.getViewMatrix() - getViewMatrix():
MatrixGets the view matrix.
Returns:
MatrixThe current view matrix.
-
View.getViewOrientationCamera() - getViewOrientationCamera(orientation:
ViewOrientation, bounding:Box, preserveModelUp: boolean?): PromiseReturns a camera set to a ViewOrientation
Parameters
orientation:
ViewOrientationThe desired view orientation for the camera.bounding:
BoxOptional bounding to fit the camera about. If not supplied, the model bounding will be used.preserveModelUp: boolean = true
Returns: Promise
-
View.injectViewOrientationChangeEvent() - injectViewOrientationChangeEvent(): void
hidden
Returns: void
-
View.isolateNodes() - isolateNodes(nodeIds: number[], duration: number?, fitNodes: boolean?, initiallyHiddenStayHidden: (None | boolean)?): Promise
Hides all nodes except those specified. Also fits the camera to those nodes’ bounding box.
Parameters
nodeIds: number[]
An array of the node IDs to be isolated.duration: number = DefaultTransitionDuration
Time in milliseconds for the camera transition to the new camera view.fitNodes: boolean = true
If true, then the view is fitted around the isolated nodes.initiallyHiddenStayHidden: (None | boolean) = null
Controls whether or not initially hidden geometries stay hidden. Default behavior is driven by [[setBehaviorInitiallyHidden]].Returns: Promise
-
View.pickAllFromPoint() - pickAllFromPoint(point:
Point2, config:PickConfig): PromisePerforms a picking operation from the given position on the canvas. All candidate entities are returned. This method does not trigger a selection event. This method will reject if the point is outside the canvas area.
Parameters
point:
Point2Canvas position to pick from.config:
PickConfigThe configuration object used for this picking operation.Returns: Promise
An object containing the result of the picking operation.
-
View.pickAllFromRay() - pickAllFromRay(ray:
Ray, config:PickConfig): PromisePerforms a selection operation from the given world-space ray. All candidate entities are returned. This method does not trigger a selection event.
Parameters
ray:
RayThe world-space ray to perform the selection with.config:
PickConfigThe configuration object used for this picking operation.Returns: Promise
An object containing the result of the picking operation.
-
View.pickFromPoint() - pickFromPoint(point:
Point2, config:PickConfig): PromisePerforms a picking operation from the given position on the canvas. The best candidate entity is be returned. This method does not trigger a selection event. This method will reject if the point is outside the canvas area.
Parameters
point:
Point2Canvas position to pick from.config:
PickConfigThe configuration object used for this picking operation.Returns: Promise
An object containing the result of the picking operation.
-
View.pickFromRay() - pickFromRay(ray:
Ray, config:PickConfig): PromisePerforms a selection operation from the given world-space ray. The best candidate entity is be returned. This method does not trigger a selection event.
Parameters
ray:
RayThe world-space ray to perform the selection with.config:
PickConfigThe configuration object used for this picking operation.Returns: Promise
An object containing the result of the picking operation.
-
View.pointToWindowPosition() -
Creates a normalized window position in the range of (-1, 1) for a given point in window space.
Parameters
pt:Point2Returns:
Point2the normalized window position
-
View.projectPoint() -
Projects a 3d world space point to a 3d screen space point.
Parameters
Returns:
Point3point projected into 3d screen space.
-
View.raycastFromPoint() -
Creates a ray based on a viewport position.
Parameters
point:
Point2The (X, Y) viewport position.Returns: (None |
Ray)The ray if it was generated, otherwise null.
-
View.redraw() - redraw(callback: () => void): void
Forces the a redraw of this view.
Parameters
callback: () => void
A function to be called once the draw is complete. This is provided instead of aPromiseto ensure the callback is called before the start of another redraw.Returns: void
-
View.removeLight() - removeLight(key:
LightKey): voidremoves a light from the scene. See [[Light]].
See also:
- [[addLight]]
- [[clearLights]]
- [[updateLight]]
Parameters
key:LightKeyReturns: void
-
View.resetCamera() - resetCamera(duration: number?): Promise
Resets the camera to the initial view of the model when first loaded.
Parameters
duration: number = DefaultTransitionDuration
the amount of time in milliseconds that the camera transition between the current and initial view should take.Returns: Promise
-
View.setAmbientLightColor() - setAmbientLightColor(value:
Color): voidSets the color of the ambient light applied to the scene. This is a constant source of light that affects every point in the scene in the same way regardless of position or surface normal.
See also [[getAmbientLightColor]].
Parameters
value:ColorReturns: void
-
View.setAmbientOcclusionEnabled() - setAmbientOcclusionEnabled(enabled: boolean?): Promise
Sets whether ambient occlusion is enabled
Parameters
enabled: boolean = true
sets whether ambient occlusion will be enabledReturns: Promise
-
View.setAmbientOcclusionRadius() - setAmbientOcclusionRadius(radius: number): Promise
Sets the ambient occlusion radius. This value represents the maximum screen-proportional distance between two points such that one will cast a shadow on the other.
Parameters
radius: number
the ambient occlusion radius.Returns: Promise
-
View.setAntiAliasingMode() - setAntiAliasingMode(antiAliasingMode:
AntiAliasingMode): PromiseSets the anti-aliasing mode for the scene.
Parameters
antiAliasingMode:AntiAliasingModeReturns: Promise
-
View.setBackfacesVisible() - setBackfacesVisible(visible: boolean): Promise
Sets whether backfaces should be rendered in the scene.
Parameters
visible: boolean
Boolean value indicating whether backfaces should be rendered.Returns: Promise
Promise that is resolved when this operation has completed.
-
View.setBackgroundColor() -
Sets the viewer background color to a gradient interpolating from the top to bottom color. For a solid color, the top and bottom color should have the same values. Background Transparency is only available with client-side rendering. To re-enable a transparent background, pass null to the parameters of this function.
When draw mode is set to
HiddenLine, the background color is defined in pouet``HiddenLineSettings HiddenLineSettings``pouet. See pouet``HiddenLineSettings.setBackgroundColor HiddenLineSettings.setBackgroundColor``pouet.Parameters
Returns: Promise
a promise that resolves when the operation has completed.
-
View.setBloomEnabled() - setBloomEnabled(value: boolean?): void
Sets whether bloom is enabled.
See [[getBloomEnabled]].
Parameters
value: boolean = trueReturns: void
-
View.setBloomIntensityScale() - setBloomIntensityScale(value: number): void
Sets the intensity of the bloom effect. This value is multiplied by the intensities of the individual layers set by [[setBloomLayers]].
See [[getBloomIntensityScale]].
Parameters
value: numberReturns: void
-
View.setBloomLayers() - setBloomLayers(layers:
BloomLayerInfo[]): voidSets the number of layers in the bloom effect and the layers’ attributes.
The bloom effect is achieved by applying a luminance filter to the source image, then progressively downsampling, blurring, and adding the results together. The result of each downsample/blur operation is fed into the next, which is executed at half the resolution of the previous. The number of stages and the behavior of each stage are controlled by this function.
See [[BloomLayerInfo]], [[getBloomLayers]].
Parameters
layers:BloomLayerInfo[]Returns: void
-
View.setBloomThreshold() - setBloomThreshold(value: number): void
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]].
Parameters
value: numberReturns: void
-
View.setBloomThresholdRampWidth() - setBloomThresholdRampWidth(value: number): void
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]].
Parameters
value: numberReturns: void
-
View.setBoundingCalculationIgnoresInvisible() - setBoundingCalculationIgnoresInvisible(value: boolean): void
Sets whether or not bounding calculations by this View object ignores invisible geometry.
Parameters
value: booleanReturns: void
-
View.setCamera() - setCamera(camera: (None |
Camera), duration: number?): booleanSets the current camera
Parameters
camera: (None |
Camera)the camera to setduration: number = 0
camera transition time in millisecondsReturns: boolean
-
View.setDisplayIncompleteFrames() - setDisplayIncompleteFrames(value: boolean): Promise
Sets whether intermediate frames of an incremental draw will be displayed. (default: true)
If false, the image will only be displayed once completely drawn, except immediately after certain operations, such as setting the camera. To disable these exceptions, call [[setInteractiveDrawDelay]] with a value of 0.
Parameters
value: booleanReturns: Promise
-
View.setDrawMode() - setDrawMode(drawMode:
DrawMode): PromiseSets the drawing mode for the scene.
Parameters
drawMode:
DrawModeThe drawing mode to set.Returns: Promise
-
View.setEyeDomeLightingBlurEdgeDistance() - setEyeDomeLightingBlurEdgeDistance(value: number): Promise
Controls the maximum Z-distance between samples taken by the blur filter used in eye-dome lighting for point clouds. The value is taken as a proportion of the screen size. Decreasing the value will result in sharper edges, and increasing the value will result in softer edges. (default: .03)
Parameters
value: numberReturns: Promise
-
View.setEyeDomeLightingBlurInterval() - setEyeDomeLightingBlurInterval(value: number): Promise
Sets the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds. (default: 1)
Parameters
value: numberReturns: Promise
-
View.setEyeDomeLightingBlurSamples() - setEyeDomeLightingBlurSamples(value: number): Promise
Sets the diameter of the blur filter used in eye-dome lighting for point clouds. Setting the value to 0 will disable blurring. (default: 7)
Parameters
value: numberReturns: Promise
-
View.setEyeDomeLightingEnabled() - setEyeDomeLightingEnabled(enabled: boolean?): Promise
Enables or disables eye-dome lighting for point clouds. (default: disabled)
Parameters
enabled: boolean = trueReturns: Promise
-
View.setEyeDomeLightingOpacity() - setEyeDomeLightingOpacity(value: number): Promise
Sets the opacity of the shading rendered by eye-dome lighting for point clouds. (default: 1)
Parameters
value: number
A number in the range [0,1].Returns: Promise
-
View.setEyeDomeLightingShadingEdgeDistance() - setEyeDomeLightingShadingEdgeDistance(value: number): Promise
Controls the shading contrast in eye-dome lighting for point clouds. The value is taken as a number of pixels. Increasing the value will result in overall lighter shading, and decreasing the value will result in overall darker shading. (default: 2)
Parameters
value: numberReturns: Promise
-
View.setFaceVisibility() - setFaceVisibility(faceVisibility: boolean): Promise
Sets the face visibility for the view.
Parameters
faceVisibility: boolean
indicates whether to draw faces.Returns: Promise
-
View.setGoochBaseColorProminence() - setGoochBaseColorProminence(prominence: number): void
Sets the prominence of the object’s base color in Gooch shading.
Parameters
prominence: number
this scalar value determines the amount of the object’s base color is applied to the final shaded color.Returns: void
-
View.setGoochBlue() - setGoochBlue(blue: number): void
Sets the value to use as the blue tone in Gooch shading.
Parameters
blue: number
the blue tone. This value should be in the range [0,1]Returns: void
-
View.setGoochLuminanceShiftStrength() - setGoochLuminanceShiftStrength(shiftStrength: number): void
Sets the strength of the luminance shift in Gooch shading.
Parameters
shiftStrength: number
this scalar values determines the amount of luminance shift that is applied to the object’s base colorReturns: void
-
View.setGoochYellow() - setGoochYellow(yellow: number): void
Sets the value to use as the yellow tone in Gooch shading.
Parameters
yellow: number
the yellow tone. This value should be in the range [0,1]Returns: void
-
View.setGroundPlane() - setGroundPlane(plane:
GroundPlane): voidDefines the invisible ground plane onto which simple shadows and reflections are projected.
See also:
- [[getGroundPlane]]
- [[setSimpleShadowEnabled]]
- [[setSimpleReflectionEnabled]]
Parameters
plane:
GroundPlaneThe plane to set.Returns: void
-
View.setHardEdgeColor() - setHardEdgeColor(value:
Color): voidSets the color of hard edges.
See also:
- [[getHardEdgeColor]]
- [[setHardEdgesEnabled]]
Parameters
value:
ColorThe color to set.Returns: void
-
View.setHardEdgeOpacity() - setHardEdgeOpacity(value: number): void
Sets the opacity of hard edges.
See also:
- [[getHardEdgeOpacity]]
- [[setHardEdgesEnabled]]
Parameters
value: number
The opacity to set.Returns: void
-
View.setHardEdgesEnabled() - setHardEdgesEnabled(value: boolean?): void
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]]
Parameters
value: boolean = true
Whether hard edges should be enabled.Returns: void
-
View.setHardEdgeThreshold() - setHardEdgeThreshold(degrees: number): void
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]]
Parameters
degrees: number
The threshold to set.Returns: void
-
View.setHardEdgeThresholdRampWidth() - setHardEdgeThresholdRampWidth(degrees: number): void
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
0will cause all edges to be drawn at full opacity.See also:
- [[getHardEdgeThresholdRampWidth]]
- [[setHardEdgesEnabled]]
Parameters
degrees: numberReturns: void
-
View.setImageBasedLightingEnabled() - setImageBasedLightingEnabled(value: boolean): void
Sets whether image-based lighting is enabled for physically-based materials.
See also:
- [[getImageBasedLightingEnabled]]
- [[setImageBasedLightingIntensity]]
- [[setImageBasedLightingOrientation]]
Parameters
value: booleanReturns: void
-
View.setImageBasedLightingEnvironment() - setImageBasedLightingEnvironment(data: (None | Uint8Array)): void
Sets the environment image used by image-based lighting applied to physically-based materials.
Passing
nullwill cause the default environment image to be used.The image should be a cube map in KTX2 format with a space-separated list of spherical harmonics coefficients stored under the “sh” metadata key.
A compatible image can be created from an equirectangular source image (such as those found at HDRI Haven) with the following process:
- cmgen: https://github.com/google/filament
- ktx2ktx2, ktx2sc: https://github.com/KhronosGroup/KTX-Software/
cmgen -x out --format=ktx --size=256 in.hdr ktx2ktx2 -o uncompressed.ktx2 out/out_ibl.ktx ktxsc --zcmp 20 -o out.ktx2 uncompressed.ktx2
Parameters
data: (None | Uint8Array)Returns: void
-
View.setImageBasedLightingIntensity() - setImageBasedLightingIntensity(value: number): void
Sets the intensity (brightness) of image-based lighting applied to physically-based materials.
The default value is 1.
See also:
- [[getImageBasedLightingIntensity]]
- [[setImageBasedLightingEnabled]]
- [[setImageBasedLightingOrientation]]
Parameters
value: numberReturns: void
-
View.setImageBasedLightingOrientation() - setImageBasedLightingOrientation(value:
ImageBasedLightingOrientation): voidSets the orientation of the image-based lighting environment applied to physically-based materials.
See also:
- [[getImageBasedLightingOrientation]]
- [[setImageBasedLightingEnabled]]
- [[setImageBasedLightingIntensity]]
Parameters
Returns: void
-
View.setInitialCamera() - setInitialCamera(camera:
Camera): voidSets the camera that will be used for the initial camera view.
Parameters
camera:CameraReturns: void
-
View.setInteractiveDrawDelay() - setInteractiveDrawDelay(value: number): Promise
Sets how long after certain operations, such as setting the camera, to wait before starting a redraw. This delay exists in order to prevent flicker during continuous interaction. The initial value is 200ms.
Parameters
value: number
The delay in millisecondsReturns: Promise
-
View.setInteractiveDrawLimitIncreaseEnabled() - setInteractiveDrawLimitIncreaseEnabled(enable: boolean): void
Sets whether or not the viewer will periodically attempt to increase the amount drawn during interaction. Setting this to
falsemay improve periodic framerate dips caused by such adjustments.Parameters
enable: booleanReturns: void
-
View.setLightingEnabled() - setLightingEnabled(enabled: boolean?): Promise
Sets whether lighting is enabled. When disabled, material colors are drawn at full intensity.
See also [[InstanceModifier.DoNotLight]], [[clearLights]].
Parameters
enabled: boolean = trueReturns: Promise
-
View.setLineJitterEnabled() - setLineJitterEnabled(value: boolean?): void
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]]
Parameters
value: boolean = trueReturns: void
-
View.setLineJitterFrequency() - setLineJitterFrequency(value: number): void
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]]
Parameters
value: numberReturns: void
-
View.setLineJitterInstanceCount() - setLineJitterInstanceCount(value: number): void
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]]
Parameters
value: numberReturns: void
-
View.setLineJitterRadius() - setLineJitterRadius(value: number): void
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]]
Parameters
value: numberReturns: void
-
View.setLineVisibility() - setLineVisibility(lineVisibility: boolean): Promise
Sets the line visibility for the view.
Parameters
lineVisibility: boolean
indicates whether to draw lines.Returns: Promise
-
View.setMassageExtremeCameras() - setMassageExtremeCameras(value: boolean): void
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
Parameters
value: boolean
Whether to modify camerasReturns: void
-
View.setMinimumFramerate() - setMinimumFramerate(minimum: number): void
Sets a minimum frame rate that will be maintained by this views. The view will use various culling techniques in order to maintain the value passed in.
Passing
0will cause the entire scene to be drawn for every frame.Parameters
minimum: number
The minimum framerate to be maintained by this view.Returns: void
-
View.setPointShape() - setPointShape(shape:
PointShape): PromiseControls the appearance of rendered points. (default: Square) See [[PointShape]].
Parameters
shape:PointShapeReturns: Promise
-
View.setPointSize() - setPointSize(size: number, unit:
PointSizeUnit): PromiseSets the diameter of rendered points. (default: 1, ScreenPixels) See [[PointSizeUnit]].
Parameters
size: number
unit:
PointSizeUnitReturns: Promise
-
View.setPointVisibilityTest() - setPointVisibilityTest(points:
Point3[]): voidSets a list of points whose visibility will be tested every time a frame is drawn by comparing them to the frame’s depth buffer. Points that are partially obscured by transparent objects are considered visible.
The results are passed to the [[CallbackMap.frameDrawn]] callback so that UI elements may be updated in sync with rendering.
See also [[testPointVisibility]].
Parameters
points:
Point3[]The points to test. An empty array will disable the test.Returns: void
-
View.setProjectionMode() - setProjectionMode(projectionMode:
Projection): voidSets the projection mode.
Parameters
projectionMode:ProjectionReturns: void
-
View.setSilhouetteColor() - setSilhouetteColor(value:
Color): voidSets the color of silhouette edges.
See also:
- [[getSilhouetteColor]]
- [[setSilhouetteEnabled]]
Parameters
value:
ColorThe color to set.Returns: void
-
View.setSilhouetteEnabled() - setSilhouetteEnabled(value: boolean?): void
Enables or disables silhouette edges.
Silhouette edges are always enabled in hidden line mode.
See also:
- [[getSilhouetteEnabled]]
- [[setSilhouetteColor]]
- [[setSilhouetteOpacity]]
- [[setSilhouetteThreshold]]
- [[setSilhouetteThresholdRampWidth]]
Parameters
value: boolean = true
Whether silhouette edges should be enabled.Returns: void
-
View.setSilhouetteOpacity() - setSilhouetteOpacity(value: number): void
Sets the opacity of silhouette edges.
See also:
- [[getSilhouetteOpacity]]
- [[setSilhouetteEnabled]]
Parameters
value: number
The opacity to set.Returns: void
-
View.setSilhouetteThreshold() - setSilhouetteThreshold(value: number): void
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]]
Parameters
value: number
The threshold to set.Returns: void
-
View.setSilhouetteThresholdRampWidth() - setSilhouetteThresholdRampWidth(value: number): void
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
0will cause all edges to be drawn at full opacity.See also:
- [[getSilhouetteThresholdRampWidth]]
- [[setSilhouetteEnabled]]
Parameters
value: numberReturns: void
-
View.setSimpleReflectionAttenuation() - setSimpleReflectionAttenuation(nearDistance: number, farDistance: number, unit:
SimpleReflectionAttenuationUnit?): voidControls how objects drawn in simple reflections fade as they move further from the ground plane.
Attenuation begins at
nearDistanceand increases linearly such that the model is not visible in the reflection beyondfarDistance.Attenuation is disabled if
farDistanceis less than or equal tonearDistance.See also:
- [[getSimpleReflectionAttenuation]]
- [[setSimpleReflectionEnabled]]
Parameters
nearDistance: number
The distance from the ground plane at which objects begin to fade.farDistance: number
The distance from the ground plane at which objects are completely faded.unit:
SimpleReflectionAttenuationUnit= SimpleReflectionAttenuationUnit.WorldThe unit in whichnearDistanceandfarDistanceare specified. If unspecified, [[SimpleReflectionAttenuationUnit.World]] will be used.Returns: void
-
View.setSimpleReflectionBlurInterval() - setSimpleReflectionBlurInterval(value: number, unit:
BlurIntervalUnit?): voidSets the distance between samples taken by the blur filter used for simple reflections.
See also:
- [[getSimpleReflectionBlurInterval]]
- [[setSimpleReflectionEnabled]]
Parameters
value: number
The interval to set.unit:
BlurIntervalUnit= BlurIntervalUnit.PixelsThe unit in which thevalueargument is specified.Returns: void
-
View.setSimpleReflectionBlurSamples() - setSimpleReflectionBlurSamples(value: number): void
Sets the diameter of the blur filter used for simple reflections. Setting the value less than or equal to
1will disable blurring.See also:
- [[getSimpleReflectionBlurSamples]]
- [[setSimpleReflectionEnabled]]
Parameters
value: numberReturns: void
-
View.setSimpleReflectionEnabled() - setSimpleReflectionEnabled(value: boolean?): void
Enables or disables simple reflections projected onto an invisible ground plane.
See also:
- [[getSimpleReflectionEnabled]]
- [[setSimpleReflectionOpacity]]
- [[setSimpleReflectionBlurSamples]]
- [[setSimpleReflectionBlurInterval]]
- [[setSimpleReflectionFadeAngle]]
Parameters
value: boolean = trueReturns: void
-
View.setSimpleReflectionFadeAngle() - setSimpleReflectionFadeAngle(degrees: number): void
Sets the angle, in degrees, between the view vector and the ground plane at which simple reflections begin to fade.
Settings the value to
0will 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]]
Parameters
degrees: number
The angle in degrees.Returns: void
-
View.setSimpleReflectionOpacity() - setSimpleReflectionOpacity(value: number): void
Sets the opacity of simple reflections.
See also:
- [[getSimpleReflectionOpacity]]
- [[setSimpleReflectionEnabled]]
Parameters
value: numberReturns: void
-
View.setSimpleShadowBlurInterval() - setSimpleShadowBlurInterval(value: number): void
Sets the distance in pixels between samples taken by the blur filter used for simple shadows.
See also:
- [[getSimpleShadowBlurInterval]]
- [[setSimpleShadowEnabled]]
Parameters
value: number
The interval to set.Returns: void
-
View.setSimpleShadowBlurSamples() - setSimpleShadowBlurSamples(value: number): void
Sets the diameter of the blur filter used for simple shadows. Setting the value to
0will disable blurring.See also:
- [[getSimpleShadowBlurSamples]]
- [[setSimpleShadowEnabled]]
Parameters
value: number
The number of samples.Returns: void
-
View.setSimpleShadowColor() - setSimpleShadowColor(color:
Color): voidSets the color of simple shadows.
See also:
- [[getSimpleShadowColor]]
- [[setSimpleShadowEnabled]]
Parameters
color:
ColorThe color to set.Returns: void
-
View.setSimpleShadowEnabled() - setSimpleShadowEnabled(value: boolean?): void
Enables or disables a full-scene shadow projected onto an invisible ground plane.
See also:
- [[getSimpleShadowEnabled]]
- [[setSimpleShadowColor]]
- [[setSimpleShadowOpacity]]
- [[setGroundPlane]]
- [[setSimpleShadowResolution]]
- [[setSimpleShadowInteractiveUpdateEnabled]]
Parameters
value: boolean = true
Whether simple shadows should be enabled.Returns: void
-
View.setSimpleShadowInteractiveUpdateEnabled() - setSimpleShadowInteractiveUpdateEnabled(value: boolean?): void
Enables or disables updates to simple shadows during user interaction.
See also:
- [[getSimpleShadowInteractiveUpdateEnabled]]
- [[setSimpleShadowEnabled]]
Parameters
value: boolean = trueReturns: void
-
View.setSimpleShadowOpacity() - setSimpleShadowOpacity(opacity: number): void
Sets the opacity of simple shadows.
See also:
- [[getSimpleShadowOpacity]]
- [[setSimpleShadowEnabled]]
Parameters
opacity: number
The opacity to set.Returns: void
-
View.setSimpleShadowResolution() - setSimpleShadowResolution(pixels: number): void
Sets the width and height in pixels of the texture image into which simple shadows are drawn.
See also:
- [[getSimpleShadowResolution]]
- [[setSimpleShadowEnabled]]
Parameters
pixels: number
The resolution to set.Returns: void
-
View.setStatisticsDisplayVisibility() - setStatisticsDisplayVisibility(visibility: boolean): Promise
Sets the display for the default statistic overlay.
Parameters
visibility: booleanReturns: Promise
-
View.setToonShadingBandCount() - setToonShadingBandCount(bandCount: number): void
Sets the number of discrete shading bands that will be used when toon shading is enabled. Each band represents a shade between dark and light which will control the final color of the pixel based on its light intensity. The default band count is 3.
Parameters
bandCount: numberReturns: void
-
View.setToonShadingSpecularFactor() - setToonShadingSpecularFactor(specularFactor: number): void
Sets a scale factor which controls the size of specular highlights when toon shading is enabled. The default value is 1.0.
Parameters
specularFactor: numberReturns: void
-
View.setTransparencyMode() - setTransparencyMode(mode:
TransparencyMode): voidSets how transparent objects are blended.
Parameters
mode:TransparencyModeReturns: void
-
View.setViewOrientation() - setViewOrientation(orientation:
ViewOrientation, duration: number?, bounding:Box, preserveModelUp: boolean?): PromiseSets the view to a standard orientation.
Parameters
orientation:
ViewOrientationThe desired view orientation for the camera.duration: number = DefaultTransitionDuration
The number of milliseconds used to transition to the new camera.bounding:
BoxOptional bounding to fit the camera about. If not supplied, the model bounding will be used.preserveModelUp: boolean = true
Indicates whether the camera up will be set according to model up or current camera.Returns: Promise
-
View.setXRayColor() Sets the color applied to nodes in x-ray mode. By default, the color is unset.
See [[unsetXRayColor]].
Parameters
element:
ElementTypethe type of geometry to apply the color tocolor:
Colorthe color to applygroup:
XRayGroup= XRayGroup.Selectedthe category of nodes that will be affected. If unspecified, [[XRayGroup.Selected]] will be used.Returns: Promise
-
View.setXRayOpacity() - setXRayOpacity(opacity: number, element:
ElementType): PromiseSets the opacity of unselected items in x-ray mode.
Parameters
opacity: number
a number between 0 and 1element:
ElementTypethe type of element to which the opacity will apply. If unspecified, the opacity will apply to all element types.Returns: Promise
-
View.setXRayTransparencyMode() - setXRayTransparencyMode(mode:
TransparencyMode): PromiseSets how transparent (unselected) objects are blended in x-ray mode.
Parameters
mode:TransparencyModeReturns: Promise
-
View.startComparison() - startComparison(nodeIdSet1: number[], nodeIdSet2: number[], config:
ComparisonConfig): voidEnables a visual comparison of two sets of nodes. The nodes specified by
nodeIdSet1are filled with one color, the nodes specified bynodeIdSet2with another color, and overlapping areas are filled with a third color.See [[endComparison]].
Parameters
nodeIdSet1: number[]
the nodes to compare againstnodeIdSet2nodeIdSet2: number[]
the nodes to compare againstnodeIdSet1config:
ComparisonConfigsettings controlling the behavior of the comparisonReturns: void
-
View.testPointVisibility() - testPointVisibility(points:
Point3[]): PromiseTests whether the given points are visible by comparing them to the depth buffer of the most-recently-drawn frame. Points that are partially obscured by transparent objects are considered visible.
If the test is to be run every time a frame is drawn, [[setPointVisibilityTest]] should be used instead for proper synchronization.
Parameters
points:
Point3[]The points to test.Returns: Promise
A list of indices of the visible points.
-
View.unprojectPoint() -
Unprojects a 2d screen space point to a 3d world space point.
Parameters
Returns: (None |
Point3)point world space point
-
View.unsetDefaultCamera() - unsetDefaultCamera(): void
Unsets the default camera. After this is called the next camera to be set will be the new default
Returns: void
-
View.unsetXRayColor() - unsetXRayColor(element:
ElementType, group:XRayGroup?): PromiseUnsets the color applied to selected items in x-ray mode. Selected items will be displayed without overriding their colors.
See [[setXRayColor]].
Parameters
element:
ElementTypethe type of geometry affected by the changegroup:
XRayGroup= XRayGroup.Selectedthe category of nodes that will be affected. If unspecified, [[XRayGroup.Selected]] will be used.Returns: Promise
-
View.updateCamera() -
Updates camera properties individually. This method should be used to incrementally update camera properties individually.
Parameters
camera:
Camerathe camera to set.Returns:
Cameraupdated camera object.
-
View.updateLight() -
Updates a light in the scene. See [[Light]].
See also:
- [[addLight]]
- [[clearLights]]
- [[removeLight]]
Parameters
Returns: void