loadView: Help function to load the view angle for the RGL 3D plot from...

Description Usage Arguments Author(s) Examples

View source: R/plot.R

Description

Help function to load the view angle for the RGL 3D plot from a file or matrix

Usage

1
2
3
4
5
6
7
8
loadView(
  fname = "view.RData",
  v = NULL,
  clear = TRUE,
  close = FALSE,
  zoom = 1,
  ...
)

Arguments

fname

The file name of the view.

v

The view matrix.

clear

Call rgl::clear3d.

close

Call rgl::rgl.close.

zoom

Zoom level.

...

Additional parameters passed to rgl::view3d.

Author(s)

Lars Relund lars@relund.dk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
view <- matrix( c(-0.412063330411911, -0.228006735444069, 0.882166087627411, 0,
0.910147845745087, -0.0574885793030262, 0.410274744033813, 0, -0.042830865830183,
0.97196090221405, 0.231208890676498, 0, 0, 0, 0, 1), nc = 4)

loadView(v = view)
A <- matrix( c(3, 2, 5, 2, 1, 1, 1, 1, 3, 5, 2, 4), nc = 3, byrow = TRUE)
b <- c(55, 26, 30, 57)
obj <- c(20, 10, 15)
plotPolytope(A, b, plotOptimum = TRUE, obj = obj, labels = "coord")

# Try to modify the angle in the RGL window
saveView(print = TRUE)  # get the view angle to insert into R code

gMOIP documentation built on Aug. 23, 2021, 5:09 p.m.