library("rgl")
library("magick")
library(OceanView)
it <- 1
sigma <- Sylt3D$sigma[,,,it]
visc <- Sylt3D$visc [,,,it]
(D <- dim(sigma)) # x, y, z
depth <- seq(max(sigma[,,D[3]], na.rm = TRUE),
max(sigma[,,1 ], na.rm = TRUE), length.out = 30)
# Viscosidad en coordenadas sigma
visc_sig <- mapsigma(visc, sigma, depth = depth,
x = Sylt3D$x, y = Sylt3D$y, resfac = 3)
# Crear y trazar las superficies
isosurf3D(visc_sig$x, visc_sig$y, -visc_sig$depth, colvar = visc_sig$var,
level = c(0.005, 0.01, 0.015), col = c("red", "blue", "green"),
scale = FALSE, expand = 0.1, ticktype = "detailed",
main = "viscosity", clab = "m2/s", alpha = 0.5,
plot = FALSE, colkey = list(side = 1))
persp3D(x = Sylt3D$x, y = Sylt3D$y, z = -Sylt3D$depth,
border = "black", col = "white", add = TRUE, plot = FALSE)
#tarda unos minutos
plotdev(phi = 30);
plotrgl(lighting = TRUE);
#Giro Automatico
play3d( spin3d( axis = c(0, 0, 1), rpm = 7), duration = 100 )
# O Generar Gif
movie3d( spin3d( axis = c(0, 0, 1), rpm = 7),
duration = 10, dir = getwd(),
type = "gif", clean = TRUE )
###################################################
install.packages("rgl")
install.packages("magick")
install.packages("OceanView")
library("rgl")
library("magick")
library(OceanView)
it <- 1
sigma <- Sylt3D$sigma[,,,it]
visc <- Sylt3D$visc [,,,it]
(D <- dim(sigma)) # x, y, z
depth <- seq(max(sigma[,,D[3]], na.rm = TRUE),
max(sigma[,,1 ], na.rm = TRUE), length.out = 30)
# Viscosidad en coordenadas sigma
visc_sig <- mapsigma(visc, sigma, depth = depth,
x = Sylt3D$x, y = Sylt3D$y, resfac = 3)
# Crear y trazar las superficies
isosurf3D(visc_sig$x, visc_sig$y, -visc_sig$depth, colvar = visc_sig$var,
level = c(0.005, 0.01, 0.015), col = c("red", "blue", "green"),
scale = FALSE, expand = 0.1, ticktype = "detailed",
main = "viscosity", clab = "m2/s", alpha = 0.5,
plot = FALSE, colkey = list(side = 1))
persp3D(x = Sylt3D$x, y = Sylt3D$y, z = -Sylt3D$depth,
border = "black", col = "white", add = TRUE, plot = FALSE)
#tarda unos minutos
plotdev(phi = 30);
plotrgl(lighting = TRUE);
play3d( spin3d( axis = c(0, 0, 1), rpm = 7), duration = 100 );
###################################################