Re: [R] export 4D data as povray density files

2010-08-27 Thread baptiste Auguié
Thanks – figure 3 is actually pretty close to what I had in mind. I had 
forgotten about this package.

I still hope to work out the povray route as the end result look really good 
(and that's probably the main point of such graphics).

Best,

baptiste


On Aug 27, 2010, at 12:37 PM, Deepayan Sarkar wrote:

> On Fri, Aug 27, 2010 at 3:41 PM, baptiste auguie
>  wrote:
>> 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.
> 
> This is not answering your question, but might the misc3d package be
> relevant for you?
> 
> http://www.jstatsoft.org/v28/i01/
> 
> -Deepayan

__
R-help@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.


Re: [R] export 4D data as povray density files

2010-08-27 Thread Jim Lemon

On 08/27/2010 08:11 PM, baptiste auguie wrote:

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


Hi Baptiste,
I once fooled around with a set of functions I wrote to produce 3D plots 
as rendered objects with POVray. The functions really just translated R 
code into POVray code and wrote a file that was then passed to the 
POVray interpreter. If you find that Deepayan's suggestion of misc3d 
won't do it, I could probably dig out the old code I wrote, although it 
wasn't exactly what you are doing.


Jim

__
R-help@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.


Re: [R] export 4D data as povray density files

2010-08-27 Thread Deepayan Sarkar
On Fri, Aug 27, 2010 at 3:41 PM, baptiste auguie
 wrote:
> 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.

This is not answering your question, but might the misc3d package be
relevant for you?

http://www.jstatsoft.org/v28/i01/

-Deepayan

__
R-help@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.


[R] export 4D data as povray density files

2010-08-27 Thread baptiste auguie
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

__
R-help@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.