View source: R/class-Vector3.R
new_vector3 | R Documentation |
Vector3
instance to store '3D' pointsCreate instances that mimic the 'three.js'
syntax.
new_vector3(x = 0, y = 0, z = 0)
as_vector3(v)
x , y , z |
numeric, must have the same length, |
v |
R object to be converted to |
A Vector3
instance
new_matrix4
, new_quaternion
vec3 <- new_vector3(
x = 1:9,
y = 9:1,
z = rep(c(1,2,3), 3)
)
vec3[]
# transform
m <- new_matrix4()
# rotation xy plane by 30 degrees
m$make_rotation_z(pi / 6)
vec3$apply_matrix4(m)
vec3[]
as_vector3(c(1,2,3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.