webGLcontrols: Write HTML/Javascript code to control a WebGL display.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

These functions write out HTML code to control WebGL displays on the same page.

Usage

1
2
3
4
5
6
7
subsetSlider(subsets, labels = names(subsets), 
             prefix = "", subscene = currentSubscene3d(), 
             init = 1, 
             id = paste0(basename(tempfile("input"))), name = id)
toggleButton(subset, label = deparse(substitute(subset)), 
	     prefix = "", subscene = currentSubscene3d(), 
	     id = paste0(basename(tempfile("input"))), name = id)

Arguments

subsets

A list of vectors of object identifiers; the slider will choose among them.

labels

Labels to display corresponding to each subset. If NULL, numeric labels will be shown.

prefix

The prefix of the WebGL scene to be controlled.

subscene

The subscene to be controlled.

init

The index of the initial subset to show.

id

The id of the input control that will be generated.

name

The name of the input control that will be generated.

subset

The subset that the button should toggle.

label

The button label.

Details

subsetSlider generates an HTML5 slider control. To display no text, set the labels to blanks.

Value

The id of the control that was generated.

Author(s)

Duncan Murdoch

See Also

writeWebGL

Examples

1
2
3
subsets <- list(1:3, 1:4, 1:5)
subsetSlider(subsets)
toggleButton(1:3)

trestletech/rgl documentation built on May 31, 2019, 7:49 p.m.