library(MeshesOperations)
library(rgl)
mesh <- torusMesh(R = 4, r = 2)
sims <- sampleOnMesh(200, mesh)
open3d(windowRect = c(50, 50, 562, 562))
view3d(0, 0, zoom = 0.75)
shade3d(mesh, color = "yellow")
points3d(sims, size = 5)
Run the code above in your browser using DataLab