rgl.user2window {rgl}R Documentation

Convert between rgl user and window coordinates

Description

This function converts from 3-dimensional user coordinates to 3-dimensional window coordinates.

Usage

rgl.user2window(x, y = NULL, z = NULL, projection = rgl.projection())
rgl.window2user(x, y = NULL, z = 0, projection = rgl.projection())
rgl.projection()

Arguments

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

Details

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" )


[Package rgl version 0.68 Index]
./usr/lib/R/site-library/rgl/html/r3d.html0000644000000000000000000