Learn R Programming

fsbrain (version 0.4.2)

cubes3D.tris: Vectorized version of cube3D.tris

Description

Vectorized version of cube3D.tris

Usage

cubes3D.tris(centers, edge_length = 1)

Arguments

centers

numerical matrix with 3 columns. Each column represents the x, y, z coordinates of a center at which to create a cube.

edge_length

numerical vector or scalar, the edge length. Must have length 1 (same edge length for all cubes), or the length must be identical to the number of rows in parameter `centers`.

Value

matrix of triangle coordinates, see cube3D.tris.

Examples

Run this code
# NOT RUN {
   # Plot a 3D cloud of 20000 voxels:
   centers = matrix(rnorm(20000*3)*100, ncol=3);
   rgl::triangles3d(cubes3D.tris(centers));

# }

Run the code above in your browser using DataLab