-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathcsg_translate.Rd
51 lines (48 loc) · 1.58 KB
/
csg_translate.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/csg_construct.R
\name{csg_translate}
\alias{csg_translate}
\title{CSG Translate}
\usage{
csg_translate(object, x = 0, y = 0, z = 0)
}
\arguments{
\item{object}{CSG object.}
\item{x}{Default `0`. x translation.}
\item{y}{Default `0`. y translation.}
\item{z}{Default `0`. z translation.}
}
\value{
List describing the triangle in the scene.
}
\description{
CSG Translate
}
\examples{
if(run_documentation()) {
#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, samples=16,lookfrom=c(0,5,10),fov=30,
lookat=c(-1,0.5,-1))
}
if(run_documentation()) {
#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, samples=16,lookfrom=c(0,5,10),fov=30,
lookat=c(-1.5,0.5,-1.5))
}
}