jorkku
jorkku

Reputation: 147

Rectangular prism in R rgl

Is there a way to create a rectangular prism in R rgl similar to the cube3d function? I can always combine many cubes to make a rectangular prism, but are there some ready made functions for it?

Upvotes: 1

Views: 224

Answers (1)

sebastian-c
sebastian-c

Reputation: 15405

You can change the matrix supplied to it, for example:

rectmat <- identityMatrix()*c(1,2)
rect <- cube3d(rectmat)
plot3d(rect)

Upvotes: 1

Related Questions