View source: R/csg_construct.R
csg_ellipsoid | R Documentation |
CSG Ellipsoid
csg_ellipsoid(x = 0, y = 0, z = 0, axes = c(0.5, 1, 0.5))
x |
Default '0'. x-coordinate on the ellipsoid. |
y |
Default '0'. y-coordinate on the ellipsoid. |
z |
Default '0'. z-coordinate on the ellipsoid. |
axes |
Default 'c(0.5,1,0.5)'. Ellipsoid principle axes. |
List describing the ellipsoid in the scene.
if(run_documentation()) {
#Generate a basic ellipsoid:
generate_ground(material=diffuse(checkercolor="grey20")) %>%
add_object(csg_object(csg_ellipsoid(),material=glossy(color="red"))) %>%
render_scene(clamp_value=10, samples=16,fov=20)
}
if(run_documentation()) {
#Three different ellipsoids:
generate_ground(material=diffuse(checkercolor="grey20")) %>%
add_object(csg_object(csg_group(list(
csg_ellipsoid(x=-1.2, axes = c(0.2,0.5,0.5)),
csg_ellipsoid(x=0, axes = c(0.5,0.2,0.5)),
csg_ellipsoid(x=1.2, axes = c(0.5,0.5,0.2)))),
material=glossy(color="red"))) %>%
render_scene(clamp_value=10, samples=16,fov=20,lookfrom=c(0,5,10))
}
if(run_documentation()) {
#Generate a glass ellipsoid:
generate_ground(material=diffuse(checkercolor="grey20")) %>%
add_object(csg_object(csg_ellipsoid(),material=dielectric(attenuation = c(1,1,0.3)))) %>%
render_scene(clamp_value=10, samples=16,fov=20)
}
if(run_documentation()) {
#Generate a glass ellipsoid in a Cornell box:
generate_cornell() %>%
add_object(csg_object(csg_ellipsoid(x=555/2,y=555/2,z=555/2,axes=c(100,150,200)),
material=dielectric(attenuation = c(1,0.3,1)/200))) %>%
render_scene(clamp_value=10, samples=16)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.