This object takes an object constructed using the csg_* functions. The object is drawn using ray marching/sphere tracing.

csg_object(
object,
x = 0,
y = 0,
z = 0,
material = diffuse(),
angle = c(0, 0, 0),
order_rotation = c(1, 2, 3),
flipped = FALSE,
scale = c(1, 1, 1)
)

## Arguments

object

Object created with CSG interface.

x

Default 0. x-offset of the center of the object.

y

Default 0. y-offset of the center of the object.

z

Default 0. z-offset of the center of the object.

material

Default diffuse. The material, called from one of the material functions diffuse, metal, or dielectric.

angle

Default c(0, 0, 0). Angle of rotation around the x, y, and z axes, applied in the order specified in order_rotation.

order_rotation

Default c(1, 2, 3). The order to apply the rotations, referring to "x", "y", and "z".

flipped

Default FALSE. Whether to flip the normals.

scale

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.

## Value

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

## Details

Note: For dielectric objects, any other objects not included in the CSG object and nested inside will be ignored.

## Examples

if(rayrender:::run_documentation()) {
#We will combine these three objects:
generate_ground(material=diffuse(checkercolor="grey20")) %>%
material=glossy(color="blue"))) %>%
render_scene(clamp_value=10, fov=15,lookfrom=c(5,5,10),
samples=128, sample_method="sobol_blue")
}

if(rayrender:::run_documentation()) {
#Standard CSG sphere + box - crossed cylinder combination:
generate_ground(material=diffuse(checkercolor="grey20")) %>%
csg_combine(
csg_box(),
operation="intersection"),
operation="subtract"),
material=glossy(color="red"))) %>%
render_scene(clamp_value=10, fov=10,lookfrom=c(5,5,10),
samples=128, sample_method="sobol_blue")
}

if(rayrender:::run_documentation()) {
generate_ground(material=diffuse(checkercolor="grey20")) %>%
csg_combine(
csg_box(),