Skip to content

movie3d in rgl object 'movie' not found

2 messages · harryxgordon, Brian Ripley

#
Hello,

I am trying to save a .gif movie using movie3d from the package {rgl}.  I am
using the following code combined with the globe example on the ?movie3d
page.  I've installed ImageMagick and the directory seems to be working
properly, i.e. when I do Sys.getenv("PATH"), C:\\Program Files
(x86)\\ImageMagick-6.7.0-Q16 shows up.

####

library(rgl)
open3d()

lat <- matrix(seq(90,-90, len=50)*pi/180, 50, 50, byrow=TRUE)
long <- matrix(seq(-180, 180, len=50)*pi/180, 50, 50)

r <- 6378.1 # radius of Earth in km
x <- r*cos(lat)*cos(long)
y <- r*cos(lat)*sin(long)
z <- r*sin(lat)
persp3d(x, y, z, col="white", 
       texture=system.file("textures/world.png",package="rgl"), 
       specular="black", axes=FALSE, box=FALSE, xlab="", ylab="", zlab="",
       normal_x=x, normal_y=y, normal_z=z)

#I run the above, note the device ID and then enter the following with
rgl.cur(1) if my device ID is 1.

movie3d(par3dinterp(par3dsave(params = c("userMatrix", "scale", "zoom",
"FOV"), times = FALSE, dev = rgl.cur(1))), duration = 5, fps = 10, movie =
"movie", frames = movie, dir=tempdir(), type = "gif")

#The par3d window pops up, I move the globe around a bit and press "record"
a few times.  Then when I press "quit", I get the following error:

Error in sprintf("%s%03d.png", frames, i) : object 'movie' not found

####

Sorry if I've made a silly mistake; I'm kind of a newb.  I haven't found any
record of this same issue on the web.


Many Thanks!
Michelle



--
View this message in context: http://r.789695.n4.nabble.com/movie3d-in-rgl-object-movie-not-found-tp3572316p3572316.html
Sent from the R help mailing list archive at Nabble.com.
#
On Fri, 3 Jun 2011, someone ashamed of his/her real name wrote:

            
But rgl.cur() is the current device, and it does not take an argument 
in the version of rgl I have.
I think you meant to set dev= in movie3d, not par3dsave (which appears 
to be part of package tkrgl which you failed to even mention).
Don't give the values of arguments that you want to take default 
values.  Specifying 'frames = movie' is not the same thing as using 
the default value (the scoping rules differ).  None of

fps = 10, movie = "movie", frames = movie, dir=tempdir(), type = "gif")

is needed (nor would dev = rgl.cur() be).