| rgl.user2window {rgl} | R Documentation |
This function converts from 3-dimensional user coordinates to 3-dimensional window coordinates.
rgl.user2window(x, y = NULL, z = NULL, projection = rgl.projection()) rgl.window2user(x, y = NULL, z = 0, projection = rgl.projection()) rgl.projection()
x, y, z |
Input coordinates. Any reasonable way of defining the
coordinates is acceptable. See the function xyz.coords
for details. |
projection |
The rgl projection to use |
These functions convert between user coordinates and window coordinates.
Window coordinates vertices <- c( -1.0, -1.0, 0, 1.0, 1.0, -1.0, 0, 1.0, 1.0, 1.0, 0, 1.0, -1.0, 1.0, 0, 1.0 ) indices <- c( 1, 2, 3, 4 ) open3d() wire3d( qmesh3d(vertices,indices) ) # render 4 meshes vertically in the current view open3d() bg3d("gray") l0 <- oh3d(tran = par3d("userMatrix"), color = "green" ) shade3d( translate3d( l0, -6, 0, 0 )) l1 <- subdivision3d( l0 ) shade3d( translate3d( l1 , -2, 0, 0 ), color="red", override = FALSE ) l2 <- subdivision3d( l1 ) shade3d( translate3d( l2 , 2, 0, 0 ), color="red", override = TRUE ) l3 <- subdivision3d( l2 ) shade3d( translate3d( l3 , 6, 0, 0 ), color="red" )