These functions give information about the attributes of RGL objects. rgl.attrib.info is the more “user-friendly” function; rgl.attrib.count is a lower-level function more likely to be used in programming.

rgl.attrib.info(id = ids3d("all", 0)$id, attribs = NULL, showAll = FALSE)
rgl.attrib.count(id, attrib)

Arguments

id

One or more RGL object ids.

attribs

A character vector of one or more attribute names.

showAll

Should attributes with zero entries be shown?

attrib

A single attribute name.

Details

See the first example below to get the full list of attribute names.

Value

A dataframe containing the following columns:

id

The id of the object.

attrib

The full name of the attribute.

nrow, ncol

The size of matrix that would be returned by rgl.attrib for this attribute.

Author

Duncan Murdoch

See also

rgl.attrib to obtain the attribute values.

Examples

open3d()
id <- points3d(rnorm(100), rnorm(100), rnorm(100), col = "green")
rgl.attrib.info(id, showAll = TRUE)
#>      id     attrib nrow ncol
#> 1  3678   vertices  100    3
#> 2  3678    normals    0    3
#> 3  3678     colors    1    4
#> 4  3678  texcoords    0    2
#> 5  3678        dim    0    2
#> 6  3678      texts    0    1
#> 7  3678        cex    0    1
#> 8  3678        adj    0    3
#> 9  3678      radii    0    1
#> 10 3678    centers  100    3
#> 11 3678        ids    0    1
#> 12 3678 usermatrix    0    4
#> 13 3678      types    0    1
#> 14 3678      flags    1    1
#> 15 3678    offsets    0    1
#> 16 3678     family    0    1
#> 17 3678       font    0    1
#> 18 3678        pos    0    1
#> 19 3678   fogscale    0    1
#> 20 3678       axes    0    3
#> 21 3678    indices    0    1
#> 22 3678   shapenum    0    1
rgl.attrib.count(id, "vertices")
#> [1] 100

merge(rgl.attrib.info(), ids3d("all"))
#>      id   attrib nrow ncol       type
#> 1  3675   colors    3    4      light
#> 2  3675    flags    2    1      light
#> 3  3675 vertices    1    3      light
#> 4  3677    flags    4    1 background
#> 5  3677 fogscale    1    1 background
#> 6  3677   colors    1    4 background
#> 7  3677  centers    1    3 background
#> 8  3678   colors    1    4     points
#> 9  3678  centers  100    3     points
#> 10 3678 vertices  100    3     points
#> 11 3678    flags    1    1     points