[R] rgl and lighting

james.foadi at diamond.ac.uk james.foadi at diamond.ac.uk
Thu Sep 9 18:02:08 CEST 2010


Dear R community (and Duncan more specifically),
I can't work out how to make additional light sources work in rgl.
Here is the example.

First I create a cube and visualize it:

> cubo <- cube3d(col="black")
> shade3d(cubo)

Next I position the viewpoint at theta=0 and phi=30:

> view3d(theta=0,phi=30)

Next, I want to create a 2nd light source which diffuses red light from the front face. I thought I could do:

>light3d(diffuse="red",theta=0,phi=0)

but...the front side doesn't show any red-iness. Same goes for specular and ambient.
What am I doing wrong here? How should the fron side show in red colour?

J

Dr James Foadi PhD
Membrane Protein Laboratory (MPL)
Diamond Light Source Ltd
Diamond House
Harewell Science and Innovation Campus
Chilton, Didcot
Oxfordshire OX11 0DE

Email    :  james.foadi at diamond.ac.uk
Alt Email:  j.foadi at imperial.ac.uk


-- 
This e-mail and any attachments may contain confidential...{{dropped:8}}



More information about the R-help mailing list