SOCR ≫ | TCIU Website ≫ | TCIU GitHub ≫ |
Per Milen … (other examples) …
# To Render the rgl/contour3d window in the DOCX/HTML output via knitter, we can use the following protocol:
library(misc3d)
library(rgl)
load("Fig3.11.Rdata")
# Opening rgl window to display in html page
invisible(open3d(useNULL = T, windowRect = c(0,0,800,800), zoom = 1))
display1 <-
contour3d(img1, level = c(7, 12), alpha = c(0.3, 0.5), add = TRUE,
color=c("yellow", "red"), perspective=T, distance=0.8)
# Aspect ratio and axes
aspect3d(1.0, 1.0, 1.0)
axes3d()
# Display scene
rglwidget(width = 800, height = 600, elementId = "model1") %>%
toggleWidget(ids = display1, label = "Recente") # %>%
# toggleWidget(ids = display2, label = "Rio do Rasto") %>%
# Show the Phases
# Opening rgl window to display in html page
invisible(open3d(useNULL = T, windowRect = c(0,0,800,800), zoom = 1))
X1_phase_nill <- atan2(0, Re(X1))
display1 <-
contour3d(X1_phase_nill, level = c(0, 2),
alpha = c(0.3, 0.5), add = TRUE, color=c("yellow", "red"))
# Aspect ratio and axes
aspect3d(1.0, 1.0, 1.0)
axes3d()
# Display scene
rglwidget(width = 800, height = 600, elementId = "model1") %>%
toggleWidget(ids = display1, label = "Recente")