Rotate Lines
rotate_lines( lines, angle = c(0, 0, 0), pivot_point = c(0, 0, 0), order_rotation = c(1, 2, 3) )
lines | The existing line scene. |
---|---|
angle | Default `c(0,0,0)`. The rotation amount for the x/y/z axes, in degrees. |
pivot_point | Default `c(0,0,0)`. The pivot point of the rotation. |
order_rotation | Default `c(1,2,3)`. The order in which to perform the rotations.#' |
Rotated lines.
#Generate a cube out of lines # \donttest{ 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)) #> Setting `lookat` to: c(0.00, 0.00, 0.00) #> Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘terra’ #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)) #> Setting `lookat` to: c(0.00, 0.00, 0.00) #> Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘terra’ #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)) #> Setting `lookat` to: c(0.00, 0.00, 0.00) #> Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘terra’ #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)) #> Setting `lookat` to: c(0.00, 0.00, 0.00) #> Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘terra’ # }