-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathcylinder.Rd
88 lines (74 loc) · 3.09 KB
/
cylinder.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/objects.R
\name{cylinder}
\alias{cylinder}
\title{Cylinder Object}
\usage{
cylinder(
x = 0,
y = 0,
z = 0,
radius = 1,
length = 1,
phi_min = 0,
phi_max = 360,
material = diffuse(),
angle = c(0, 0, 0),
order_rotation = c(1, 2, 3),
flipped = FALSE,
scale = c(1, 1, 1),
capped = TRUE
)
}
\arguments{
\item{x}{Default `0`. x-coordinate of the center of the cylinder}
\item{y}{Default `0`. y-coordinate of the center of the cylinder}
\item{z}{Default `0`. z-coordinate of the center of the cylinder}
\item{radius}{Default `1`. Radius of the cylinder.}
\item{length}{Default `1`. Length of the cylinder.}
\item{phi_min}{Default `0`. Minimum angle around the segment.}
\item{phi_max}{Default `360`. Maximum angle around the segment.}
\item{material}{Default \code{\link{diffuse}}.The material, called from one of the material
functions \code{\link{diffuse}}, \code{\link{metal}}, or \code{\link{dielectric}}.}
\item{angle}{Default `c(0, 0, 0)`. Angle of rotation around the x, y, and z axes, applied in the order specified in `order_rotation`.}
\item{order_rotation}{Default `c(1, 2, 3)`. The order to apply the rotations, referring to "x", "y", and "z".}
\item{flipped}{Default `FALSE`. Whether to flip the normals.}
\item{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.}
\item{capped}{Default `TRUE`. Whether to add caps to the segment. Turned off when using the `light()` material.
Note: emissive objects may not currently function correctly when scaled.}
}
\value{
Single row of a tibble describing the cylinder in the scene.
}
\description{
Cylinder Object
}
\examples{
#Generate a cylinder in the cornell box. Add a cap to both ends.
if(run_documentation()) {
generate_cornell() \%>\%
add_object(cylinder(x = 555/2, y = 250, z = 555/2,
length = 300, radius = 100, material = metal())) \%>\%
render_scene(lookfrom = c(278, 278, -800) ,lookat = c(278, 278, 0), fov = 40,
ambient_light = FALSE, samples = 16, parallel = TRUE, clamp_value = 5)
}
#Rotate the cylinder
if(run_documentation()) {
generate_cornell() \%>\%
add_object(cylinder(x = 555/2, y = 250, z = 555/2,
length = 300, radius = 100, angle = c(0, 0, 45),
material = diffuse())) \%>\%
render_scene(lookfrom = c(278, 278, -800) ,lookat = c(278, 278, 0), fov = 40,
ambient_light = FALSE, samples = 16, parallel = TRUE, clamp_value = 5)
}
# Only render a subtended arc of the cylinder, flipping the normals.
if(run_documentation()) {
generate_cornell(lightintensity=3) \%>\%
add_object(cylinder(x = 555/2, y = 250, z = 555/2, capped = FALSE,
length = 300, radius = 100, angle = c(45, 0, 0), phi_min = 0, phi_max = 180,
material = diffuse(), flipped = TRUE)) \%>\%
render_scene(lookfrom = c(278, 278, -800) ,lookat = c(278, 278, 0), fov = 40,
ambient_light = FALSE, samples = 16, parallel = TRUE, clamp_value = 5)
}
}