rotate_lines {rayvertex} | R Documentation |
Rotate Lines
Description
Rotate Lines
Usage
rotate_lines(
lines,
angle = c(0, 0, 0),
pivot_point = c(0, 0, 0),
order_rotation = c(1, 2, 3)
)
Arguments
lines |
The existing line scene. |
angle |
Default |
pivot_point |
Default |
order_rotation |
Default |
Value
Rotated lines.
Examples
if(run_documentation()) {
#Generate a cube out of lines
cube_outline = generate_line(start = c(-1, -1, -1), end = c(-1, -1, 1)) |>
add_lines(generate_line(start = c(-1, -1, -1), end = c(-1, 1, -1))) |>
add_lines(generate_line(start = c(-1, -1, -1), end = c(1, -1, -1))) |>
add_lines(generate_line(start = c(-1, -1, 1), end = c(-1, 1, 1))) |>
add_lines(generate_line(start = c(-1, -1, 1), end = c(1, -1, 1))) |>
add_lines(generate_line(start = c(-1, 1, 1), end = c(-1, 1, -1))) |>
add_lines(generate_line(start = c(-1, 1, 1), end = c(1, 1, 1))) |>
add_lines(generate_line(start = c(1, 1, -1), end = c(1, -1, -1))) |>
add_lines(generate_line(start = c(1, 1, -1), end = c(1, 1, 1))) |>
add_lines(generate_line(start = c(1, -1, -1), end = c(1, -1, 1))) |>
add_lines(generate_line(start = c(1, -1, 1), end = c(1, 1, 1))) |>
add_lines(generate_line(start = c(-1, 1, -1), end = c(1, 1, -1)))
rasterize_lines(cube_outline,lookfrom=c(0,6,10))
}
if(run_documentation()) {
#Rotate the cube 30 degrees around the y-axis
rotated_cube = color_lines(rotate_lines(cube_outline,angle=c(0,30,0)),color="red")
rasterize_lines(add_lines(cube_outline,rotated_cube),lookfrom=c(0,6,10))
}
if(run_documentation()) {
#Rotate the cube 30 degrees around each axis, in this order: x,y,z
rotated_cube = color_lines(rotate_lines(cube_outline,angle=c(30,30,30)),color="red")
rasterize_lines(add_lines(cube_outline,rotated_cube),lookfrom=c(0,6,10))
}
if(run_documentation()) {
#Rotate the cube 30 degrees around each axis, in this order: z,y,x
rotated_cube = color_lines(rotate_lines(cube_outline,angle=c(30,30,30),
order_rotation = c(3,2,1)),color="red")
rasterize_lines(add_lines(cube_outline,rotated_cube),lookfrom=c(0,6,10))
}
[Package rayvertex version 0.11.4 Index]