[R] movie3d function in the rgl package

Daniel McGlinn daniel.mcglinn at okstate.edu
Wed Oct 1 23:06:34 CEST 2008

Dear Duncan,

Thanks for your quick response!  I really like the rgl package.  First a
clarification.  I was not using IMDisplay to try to view the .gif file.
I apologize for that confusion.  I attempted to open the file with
Mozilla firefox which works but unfortunately only displays a black box.

Also I tried your suggestion of running R as an administrator and this
did not solve the problem.  I can write files from R into the bin
directory for example I can use the function "png" to create a single
image of a normal graphic (not a 3d graphic from the rgl package).  Also
changing the directory to the default such that the function movie3d
creates a new temporary file did not solve the problem.  It should be
noted that files (.png and .gif) are being generated by the function
movie3d and they have non-zero file sizes, it is just that they are all
completely black.  I will attempt to run the function in Windows XP to
see if I can generate different results just in case it is some kind of
Vista quirk.

Thanks again,


Duncan Murdoch wrote:
> Daniel McGlinn wrote:
>> Dear list,
>> I am attempting to utilize the function "movie3d" in the package "rgl"
>> to create a .gif animation of a 3d graphic.  I understand that this
>> function requires that the program "ImageMagik" is installed, and I have
>> recently downloaded and installed this program.  The R console does not
>> report any errors, however all the .png files as well as the .gif files
>> that are created by the function are all completely black.
>> My OS is Windows Vista Home, R v2.7.2, IMDisplay v1.0.  I have verified
>> that IMDisplay is functioning by running this program for a different task.
> Why are you using IMDisplay?  You should be able to view gif or png
> files in lots of standard Windows programs, e.g. Internet Explorer or
> Firefox.
>> Sample code (taken from ?movie3d):
>> open3d()
>> plot3d( cube3d(col="green") )
>> M <- par3d("userMatrix")
>> movie3d( spin3d(), duration=5, dir="C:/R/R-2.7.2/bin/movie", clean=FALSE )
> Do you have write permission in that directory?  Try running R as an
> administrator, or try writing into a directory you're sure you can write
> to.  Normally writing to the bin directory is a bad idea, and Vista
> might be protecting you from that.
> Duncan Murdoch
>> ##R console reports the following
>> Writing movie000.png
>> Writing movie001.png
>> ...
>> Writing movie050.png
>> Will create:  C:/R/R-2.7.2/bin/movie/movie.gif
>> Executing:  convert -delay 1x10 movie*.png movie.gif
>> Any help on this would be appreciated.
>> Thanks,
>> Dan

Daniel J. McGlinn, Botany Department, Oklahoma State University
117 LSE Stillwater OK 74078 USA 405-612-1780

More information about the R-help mailing list