scale_lines {rayvertex} | R Documentation |
Scale Lines
Description
Scale Lines
Usage
scale_lines(lines, scale = 1)
Arguments
lines |
The line scene. |
scale |
Default |
Value
Scaled line matrix.
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,fov=90,lookfrom=c(0,0,3))
}
if(run_documentation()) {
#Scale the cube uniformly
scaled_cube = color_lines(scale_lines(cube_outline,scale=0.5),color="red")
rasterize_lines(add_lines(cube_outline,scaled_cube),fov=90,lookfrom=c(0,0,3))
}
if(run_documentation()) {
#Scale the cube non-uniformly
scaled_cube = color_lines(scale_lines(cube_outline,scale=c(0.8,2,0.4)),color="red")
rasterize_lines(add_lines(cube_outline,scaled_cube),fov=60,lookfrom=c(3,3,3))
}
[Package rayvertex version 0.11.4 Index]