Note: this is just a scaled sphere.
Default `0`. x-coordinate of the center of the ellipsoid.
Default `0`. y-coordinate of the center of the ellipsoid.
Default `0`. z-coordinate of the center of the ellipsoid.
Default `1`. Principal x-axis of the ellipsoid.
Default `1`. Principal y-axis of the ellipsoid.
Default `1`. Principal z-axis of the ellipsoid.
Default diffuse
.The material, called from one of the material
functions diffuse
, metal
, or dielectric
.
Default `c(0, 0, 0)`. Angle of rotation around the x, y, and z axes, applied in the order specified in `order_rotation`.
Default `c(1, 2, 3)`. The order to apply the rotations, referring to "x", "y", and "z".
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. Note: emissive objects may not currently function correctly when scaled.
Single row of a tibble describing the ellipsoid in the scene.
#Generate an ellipsoid in a Cornell box
if(run_documentation()) {
generate_cornell() %>%
add_object(ellipsoid(x = 555/2, y = 555/2, z = 555/2,
a = 100, b = 50, c = 50)) %>%
render_scene(lookfrom = c(278, 278, -800) ,lookat = c(278, 278, 0), fov = 40,
ambient_light = FALSE, samples = 16, parallel = TRUE, clamp_value = 5)
}
#Change the axes to make it taller rather than wide:
if(run_documentation()) {
generate_cornell() %>%
add_object(ellipsoid(x = 555/2, y = 555/2, z = 555/2,
a = 100, b = 200, c = 100, material = metal())) %>%
render_scene(lookfrom = c(278, 278, -800) ,lookat = c(278, 278, 0), fov = 40,
ambient_light = FALSE, samples = 16, parallel = TRUE, clamp_value = 5)
}
#Rotate it and make it dielectric:
if(run_documentation()) {
generate_cornell() %>%
add_object(ellipsoid(x = 555/2, y = 555/2, z = 555/2,
a = 100, b = 200, c = 100, angle = c(0, 0, 45),
material = dielectric())) %>%
render_scene(lookfrom = c(278, 278, -800) ,lookat = c(278, 278, 0), fov = 40,
ambient_light = FALSE, samples = 16, parallel = TRUE, clamp_value = 5)
}