-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathanimate_objects.Rd
149 lines (133 loc) · 5.07 KB
/
animate_objects.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/animate_objects.R
\name{animate_objects}
\alias{animate_objects}
\title{Animate Objects}
\usage{
animate_objects(
scene,
start_time = 0,
end_time = 1,
start_pivot_point = c(0, 0, 0),
start_position = c(0, 0, 0),
start_angle = c(0, 0, 0),
start_order_rotation = c(1, 2, 3),
start_scale = c(1, 1, 1),
start_axis_rotation = NA,
end_pivot_point = c(0, 0, 0),
end_position = c(0, 0, 0),
end_angle = c(0, 0, 0),
end_order_rotation = c(1, 2, 3),
end_scale = c(1, 1, 1),
end_axis_rotation = NA
)
}
\arguments{
\item{scene}{Tibble of pre-existing object locations.}
\item{start_time}{Default `0`. Start time of movement.}
\item{end_time}{Default `1`. End time of movement.}
\item{start_pivot_point}{Default `c(0,0,0)`. The point about which to pivot, scale, and move the objects.}
\item{start_position}{Default `c(0,0,0)`. Vector indicating where to offset the objects.}
\item{start_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{start_order_rotation}{Default `c(1,2,3)`. The order to apply the rotations,
referring to "x", "y", and "z".}
\item{start_scale}{Default `c(1,1,1)`. Scaling factor for x, y, and z directions for all objects.}
\item{start_axis_rotation}{Default `NA`. Provide an axis of rotation and a single angle (via `angle`) of rotation}
\item{end_pivot_point}{Default `c(0,0,0)`. The point about which to pivot, scale, and move the group.}
\item{end_position}{Default `c(0,0,0)`. Vector indicating where to offset the objects.}
\item{end_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{end_order_rotation}{Default `c(1,2,3)`. The order to apply the rotations,
referring to "x", "y", and "z".}
\item{end_scale}{Default `c(1,1,1)`. Scaling factor for x, y, and z directions for all objects.}
\item{end_axis_rotation}{Default `NA`. Provide an axis of rotation and a single angle (via `angle`) of rotation
around that axis.}
}
\value{
Tibble of animated object.
}
\description{
This function animates an object between two states. This animates objects separately from the transformations set
in `group_objects()` and in the object transformations themselves. This creates motion blur, controlled by the shutter
open/close options in `render_scene()`.
}
\examples{
#Render a pig
if(run_documentation()) {
generate_studio() \%>\%
add_object(pig(y=-1.2,scale=0.5,angle=c(0,-70,0)))\%>\%
add_object(sphere(y=5,x=5,z=5,radius=2,material=light())) \%>\%
render_scene(samples=16,sample_method = "sobol_blue")
}
if(run_documentation()) {
#Render a moving pig
generate_studio() \%>\%
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,-70,0)),
start_position = c(-0.1,0,0), end_position = c(0.1,0.2,0))
) \%>\%
add_object(sphere(y=5,x=5,z=5,radius=2,material=light())) \%>\%
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10)
}
if(run_documentation()) {
#Render a shrinking pig
generate_studio() \%>\%
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,-70,0)),
start_scale = c(1,1,1), end_scale = c(0.5,0.5,0.5))
) \%>\%
add_object(sphere(y=5,x=5,z=5,radius=2,material=light())) \%>\%
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10)
}
if(run_documentation()) {
#Render a spinning pig
generate_studio() \%>\%
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,-70,0)),
start_angle = c(0,-30,0), end_angle = c(0,30,0))
) \%>\%
add_object(sphere(y=5,x=5,z=5,radius=2,material=light())) \%>\%
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10)
}
if(run_documentation()) {
#Shorten the open shutter time frame
generate_studio() \%>\%
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,-70,0)),
start_angle = c(0,-30,0), end_angle = c(0,30,0))
) \%>\%
add_object(sphere(y=5,x=5,z=5,radius=2,material=light())) \%>\%
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10,
shutteropen=0.4, shutterclose = 0.6)
}
if(run_documentation()) {
#Change the time frame when the shutter is open
generate_studio() \%>\%
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,-70,0)),
start_angle = c(0,-30,0), end_angle = c(0,30,0))
) \%>\%
add_object(sphere(y=5,x=5,z=5,radius=2,material=light())) \%>\%
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10,
shutteropen=0, shutterclose = 0.1)
}
if(run_documentation()) {
#Shorten the time span in which the movement occurs (which, in effect,
#increases the speed of the transition).
generate_studio() \%>\%
add_object(
animate_objects(start_time = 0, end_time=0.1,
pig(y=-1.2,scale=0.5,angle=c(0,-70,0)),
start_angle = c(0,-30,0), end_angle = c(0,30,0))
) \%>\%
add_object(sphere(y=5,x=5,z=5,radius=2,material=light())) \%>\%
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10,
shutteropen=0, shutterclose = 0.1)
}
}