rgl should use two-sided shading
dmurdoch opened this issue · 1 comments
dmurdoch commented
In R, shading depends on the direction of the normal vector. For example, this code:
cube <- addNormals(cube3d(col = "red"))
open3d()
shade3d(cube)
cube$normals <- -cube$normals
cube$normals[4,] <- 1
open3d()
shade3d(cube)
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.)