Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

csg_ellipsoid

CSG Ellipsoid


Description

CSG Ellipsoid

Usage

csg_ellipsoid(x = 0, y = 0, z = 0, axes = c(0.5, 1, 0.5))

Arguments

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.

Value

List describing the ellipsoid in the scene.

Examples

#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,fov=20)
  
#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,fov=20,lookfrom=c(0,5,10))
 
#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,fov=20)
  
#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)

rayrender

Build and Raytrace 3D Scenes

v0.21.2
GPL-3
Authors
Tyler Morgan-Wall [aut, cph, cre] (<https://orcid.org/0000-0002-3131-3814>), Syoyo Fujita [ctb, cph], Melissa O'Neill [ctb, cph], Vilya Harvey [ctb, cph]
Initial release
2021-04-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.