[R] movie3d in rgl object 'movie' not found

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Jun 4 10:05:42 CEST 2011


On Fri, 3 Jun 2011, someone ashamed of his/her real name wrote:

> 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.

But rgl.cur() is the current device, and it does not take an argument 
in the version of rgl I have.

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

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

> #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.

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

>
>
> 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.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list