Help function to load the view angle for the RGL 3D plot from a file or matrix
Source:R/plot.R
loadView.Rd
Help function to load the view angle for the RGL 3D plot from a file or matrix
Arguments
- fname
The file name of the view.
- v
The view matrix.
- clear
Call
rgl::clear3d()
.- close
Call
rgl::close3d()
.- zoom
Zoom level.
- ...
Additional parameters passed to
rgl::view3d()
.
Author
Lars Relund lars@relund.dk
Examples
# \donttest{
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)
3D plot
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")
3D plot
# Try to modify the angle in the RGL window
saveView(print = TRUE) # get the view angle to insert into R code
#> 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)
# }