rgl is a 3D visualization system based on OpenGL. It provides a medium to high level interface for use in R, currently modelled on classic R graphics, with extensions to allow for interaction.
The WebGL displays using rglwidget() are the same in both cases, as they should be. (They are different because of Gouraud shading in R vs Phong shading in WebGL.)
In R, shading depends on the direction of the normal vector. For example, this code:
gives these displays:
The WebGL displays using
rglwidget()
are the same in both cases, as they should be. (They are different because of Gouraud shading in R vs Phong shading in WebGL.)