Cone Object

cone(
start = c(0, 0, 0),
end = c(0, 1, 0),
direction = NA,
from_center = TRUE,
material = diffuse(),
angle = c(0, 0, 0),
velocity = c(0, 0, 0),
flipped = FALSE,
scale = c(1, 1, 1)
)

## Arguments

start Default c(0, 0, 0). Base of the cone, specifying x, y, z. Default c(0, 1, 0). Tip of the cone, specifying x, y, z. Default 1. Radius of the bottom of the cone. Default NA. Alternative to start and end, specify the direction (via a length-3 vector) of the cone. Cone will be centered at start, and the length will be determined by the magnitude of the direction vector. Default TRUE. If orientation specified via direction, setting this argument to FALSE will make start specify the bottom of the cone, instead of the middle. Default diffuse.The material, called from one of the material functions diffuse, metal, or dielectric. Default c(0, 0, 0). Rotation angle. Note: This will change the start and end coordinates. Default c(0, 0, 0). Velocity of the segment. Default FALSE. Whether to flip the normals. Default c(1, 1, 1). Scale transformation in the x, y, and z directions. If this is a single value, number, the object will be scaled uniformly. Notes: this will change the stated start/end position of the cone. Emissive objects may not currently function correctly when scaled.

## Value

Single row of a tibble describing the cone in the scene.

## Examples

#Generate a cone in a studio, pointing upwards:
# \donttest{
generate_studio() %>%
render_scene(samples=400,clamp_value=10)
#Change the radius, length, and direction
generate_studio() %>%
render_scene(samples=400,clamp_value=10)
#Give custom start and end points (and customize the color/texture)
generate_studio() %>%
material = diffuse(color="red",gradient_color="green"))) %>%
render_scene(samples=400,clamp_value=10)

#Specify cone via direction and location, instead of start and end positions
#Length is derived from the magnitude of the direction.
gold_mat = microfacet(roughness=0.1,eta=c(0.216,0.42833,1.3184), kappa=c(3.239,2.4599,1.8661))
generate_studio() %>%
add_object(cone(start = c(-1,0,0), direction = c(-0.5,0.5,0), material = gold_mat)) %>%
add_object(cone(start = c(1,0,0), direction = c(0.5,0.5,0), material = gold_mat)) %>%
add_object(cone(start = c(0,0,-1), direction = c(0,0.5,-0.5), material = gold_mat)) %>%
add_object(cone(start = c(0,0,1), direction = c(0,0.5,0.5), material = gold_mat)) %>%
render_scene(lookfrom=c(0,4,10), clamp_value=10, samples=400)
#Render the position from the base, instead of the center of the cone:
noise_mat = material = glossy(color="purple",noisecolor="blue", noise=5)
generate_studio() %>%
add_object(cone(start = c(0,-1,0), from_center = FALSE, radius=1, direction = c(0,2,0),
material = noise_mat)) %>%
add_object(cone(start = c(-1.5,-1,0), from_center = FALSE, radius=0.5, direction = c(0,1,0),
material = noise_mat)) %>%
add_object(cone(start = c(1.5,-1,0), from_center = FALSE, radius=0.5, direction = c(0,1,0),
material = noise_mat)) %>%
add_object(cone(start = c(0,-1,1.5), from_center = FALSE, radius=0.5, direction = c(0,1,0),
material = noise_mat)) %>%