1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
library(rgl)
test_that("rgl.user2window and rgl.window2user work", {
xyz <- rbind(x = c(2, 4, 6))
abc <- rbind(x = c(0.1, 0.2, 0.3))
open3d()
mfrow3d(2, 2)
points3d(1:10, 1:10, 1:10)
expect_equal(rgl.window2user(rgl.user2window(xyz)), xyz)
expect_equal(rgl.user2window(rgl.window2user(abc)), abc)
next3d()
points3d(1:10, 1:10, 1:10)
expect_equal(rgl.window2user(rgl.user2window(xyz)), xyz)
expect_equal(rgl.user2window(rgl.window2user(abc)), abc)
next3d()
points3d(1:10, 1:10, 1:10)
expect_equal(rgl.window2user(rgl.user2window(xyz)), xyz)
expect_equal(rgl.user2window(rgl.window2user(abc)), abc)
next3d()
points3d(1:10, 1:10, 1:10)
expect_equal(rgl.window2user(rgl.user2window(xyz)), xyz)
expect_equal(rgl.user2window(rgl.window2user(abc)), abc)
})
|