svg.bboxLight: Adds light(s) to Viewer

View source: R/svg.bboxLight.R

svg.bboxLightR Documentation

Adds light(s) to Viewer

Description

Adds point light(s) in Viewer at corners of bounding box.

Usage

svg.bboxLight(x=c(1,1,1), col='#FFFFDD', intensity=1, distance=3, hidden = TRUE)

Arguments

x

The corner(s) where a light source (vector) or multiple light sources (matrix) should be added.

col

The color of the light.

intensity

The intensity of the light.

distance

The distance from the light where the intensity is 0.

hidden

A logical indicating whether the light source location should be indicated by a yellow sphere. By default the sphere is hidden. Setting this to FALSE may be useful for troubleshooting light positions (so that they can be viewed directly in the scene).

Details

This function only works in the webgl plotting mode (i.e. when the mode parameter of svg.new is 'webgl'). This function creates a point light (if x is a vector) or lights (if x is a matrix) in the Viewer scene at the specified coordinates (x). The point light is the PointLight object in the three.js library.

Value

NULL

Author(s)

Aaron Olsen

See Also

svg.new

Examples

## Not run: 
# Create new Viewer
svg.new(mode='webgl')

# Add object
svg.cylinder(ends=rbind(c(0,0,0), c(0,10,0)), radius=1, col='green')

# Add lights in four corners of the bounding box
svg.bboxLight(x=rbind(c(1,1,1), c(-1,1,1), c(-1,-1,-1), c(1,-1,-1)))

# Close connection
svg.close()

## End(Not run)

svgViewR documentation built on Aug. 29, 2023, 1:06 a.m.