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

csg_translate

CSG Translate


Description

CSG Translate

Usage

csg_translate(object, x = 0, y = 0, z = 0)

Arguments

object

CSG object.

x

Default '0'. x translation.

y

Default '0'. y translation.

z

Default '0'. z translation.

Value

List describing the triangle in the scene.

Examples

#Translate a simple object:
generate_ground(material=diffuse(checkercolor="grey20")) %>% 
  add_object(csg_object(csg_torus(), material=glossy(color="dodgerblue4"))) %>%
  add_object(csg_object(csg_translate(csg_torus(),x=-2,y=1,z=-2), 
                        material=glossy(color="red"))) %>%
  add_object(sphere(y=5,x=5,radius=3,material=light(intensity=10))) %>%  
  render_scene(clamp_value=10,lookfrom=c(0,5,10),fov=30,
               lookat=c(-1,0.5,-1))

#Translate a blended object:
generate_ground(material=diffuse(checkercolor="grey20")) %>% 
  add_object(csg_object(csg_combine(
    csg_torus(),
    csg_torus(y=1, radius=0.8), operation="blend"), material=glossy(color="dodgerblue4"))) %>%
  add_object(csg_object(csg_translate(
    csg_combine(
      csg_torus(),
      csg_torus(y=1, radius=0.8), operation="blend"),
    x=-3,y=1,z=-3),
    material=glossy(color="red"))) %>%
  add_object(sphere(y=5,x=5,radius=3,material=light(intensity=10))) %>%  
  render_scene(clamp_value=10,lookfrom=c(0,5,10),fov=30,
               lookat=c(-1.5,0.5,-1.5))

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.