[R] export 4D data as povray density files

baptiste auguie baptiste.auguie at googlemail.com
Fri Aug 27 12:11:58 CEST 2010


Dear list,

I wish to visualise some 4D data as a kind of colour / translucent
cloud in 3D. I haven't seen such plots in R (but perhaps I missed a
feature of rgl). The easiest option I found would be to export the
data in povray's df3 (density file) format and visualise it with
povray.

The format specification baffles me a little,
http://www.povray.org/documentation/view/3.6.1/374/ ; fortunately I
found a few C++ utilities that could do the conversion from a plain
ascii datafile to this format. Basically, I wish to create a set of
xyz coordinates and a scalar function value in R, export it as a
regular ascii file, convert it to df3 and visualise it in povray.

An example of data from the R side would be,

N <- 10
xx <- seq(0,N)
d <- expand.grid(x=xx,y=xx,z=xx)
d$t <- runif(nrow(d), 0, 255)

cat(file="data.dat", "1 1 1\n")
write.table(d,file="data.dat",row.names = F,
            col.names = F,append=T)

I wonder if anyone here ever played with this idea and could offer
some suggestions (I couldn't get it to work so far).

Best regards,

baptiste



-- 
____________________

Dr. Baptiste Auguié

Departamento de Química Física,
Universidade de Vigo,
Campus Universitario, 36310, Vigo, Spain

tel: +34 9868 18617
http://webs.uvigo.es/coloides



More information about the R-help mailing list