[R] positioning a light source within a rgl-plot

Alexander Senger senger at physik.hu-berlin.de
Sun Jan 27 16:37:44 CET 2013


Hello useRs,


I would like to draw a 3D-surface using rgl with a point-like
light-source within the scene, that is with finite distance of the
light-source to the surface to be lit.

>From the help to the 'light3d' command I read:

"They [the light-sources] are positioned either in world space or
relative to the camera using polar coordinates."

which *could* be understood as if such a thing would be possible. But
probably this is wishful thinking as my naive approach:

light3d(x = 0, y = 0, z = 1)

gives an error about un-used arguments in the function call. Also
skimming the web does not produce any helpful examples.

So please advise if there is a way to achieve my desired setting.
Alternatively any hint how and where to make (moderate) modifications to
the source code to get this functionality would be very welcome.


Thanks in advance.


Alex



More information about the R-help mailing list