# NOT RUN {
#Generate a pig in the cornell box.
# }
# NOT RUN {
generate_cornell() %>%
add_object(pig(x=555/2,z=555/2,y=120,scale=c(80,80,80), angle = c(0,135,0))) %>%
render_scene(parallel=TRUE, samples=400,clamp_value=10)
# }
# NOT RUN {
# Show the pig staring into a mirror, worried
# }
# NOT RUN {
generate_cornell() %>%
add_object(pig(x=555/2-70,z=555/2+50,y=120,scale=c(80,80,80),
angle = c(0,-40,0), emotion = "worried")) %>%
add_object(xy_rect(x=450,z=450,y=250, ywidth=500, xwidth=200,
angle = c(0,45,0), material = metal())) %>%
render_scene(parallel=TRUE, samples=500,clamp_value=10)
# }
# NOT RUN {
# Render many small pigs facing random directions, with an evil pig overlord
set.seed(1)
lots_of_pigs = list()
# }
# NOT RUN {
for(i in 1:10) {
lots_of_pigs[[i]] = pig(x=50 + 450 * runif(1), z = 50 + 450 * runif(1), y=50,
scale = c(30,30,30), angle = c(0,360*runif(1),0), emotion = "worried")
}
# }
# NOT RUN {
many_pigs_scene = do.call(rbind, lots_of_pigs) %>%
add_object(generate_cornell(lightintensity=20)) %>%
add_object(pig(z=500,x=555/2,y=400, emotion = "angry",
scale=c(100,100,100),angle=c(30,90,0), order_rotation=c(2,1,3)))
# }
# NOT RUN {
render_scene(many_pigs_scene,parallel=TRUE,clamp_value=10, samples=500, tonemap = "reinhold")
# }
Run the code above in your browser using DataLab