rasterize_lines {rayvertex} | R Documentation |
Rasterize Lines
Description
Render a 3D scene made out of lines using a software rasterizer.
Usage
rasterize_lines(
line_info = NULL,
filename = NA,
width = 800,
height = 800,
alpha_line = 1,
parallel = TRUE,
fov = 20,
lookfrom = c(0, 0, 10),
lookat = NULL,
camera_up = c(0, 1, 0),
color = "red",
background = "black",
debug = "none",
near_plane = 0.1,
far_plane = 100,
block_size = 4,
ortho_dimensions = c(1, 1),
bloom = FALSE,
antialias_lines = TRUE
)
Arguments
line_info |
The mesh object. |
filename |
Default |
width |
Default |
height |
Default |
alpha_line |
Default |
parallel |
Default |
fov |
Default |
lookfrom |
Default |
lookat |
Default |
camera_up |
Default |
color |
Default |
background |
Default |
debug |
Default |
near_plane |
Default |
far_plane |
Default |
block_size |
Default |
ortho_dimensions |
Default |
bloom |
Default |
antialias_lines |
Default |
Value
Rasterized image.
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))
}