powered by
This generic and its methods extract or creates a matrix of coordinates of triangles from an object, suitable for passing to triangles3d.
triangles3d
as.triangles3d(obj, ...) # S3 method for rglId as.triangles3d(obj, attribute = c("vertices", "normals", "texcoords", "colors"), subscene = NA, ...)
An n x 3 matrix containing the vertices of triangles making up the object. Each successive 3 rows of the matrix corresponds to a triangle.
n x 3
If the attribute doesn't exist, NULL will be returned.
NULL
The object to convert.
Which attribute of an RGL object to extract?
Which subscene is this object in?
Additional arguments used by the methods.
Duncan Murdoch
The method for "rglId" objects can extract several different attributes, organizing them as it would organize the vertices for the triangles.
"rglId"
as.mesh3d to also capture material properties.
as.mesh3d
open3d() x <- surface3d(x = 1:10, y = 1:10, z = rnorm(100), col = "red") tri <- as.triangles3d(x) open3d() triangles3d(tri, col = "blue")
Run the code above in your browser using DataLab