R语言rayrender包,csg_round融合空间体
csg_roundÈںϿռäÌå.png# Thu Jun 17 01:33:42 2021 -
# 字符编码:UTF-8
# R 版本:R x64 4.1 for window 10
# cgh163email@163.com
# 个人笔记不负责任,拎了个梨🍐🌷
.rs.restartR()
require(rayrender)
rm(list = ls());gc()
csg_round融合空间体
generate_ground(material=diffuse(checkercolor="grey20")) %>%
add_object(csg_object(csg_pyramid(x=-1,y=-0.99,z=1),
material=glossy(color="red"))) %>%
add_object(csg_object(csg_round(csg_pyramid(x=1,y=-0.89)),
material=glossy(color="blue"))) %>%
add_object(csg_object(csg_round(csg_pyramid(x=0,z=-2,y=-0.5), radius=0.5),
material=glossy(color="green"))) %>%
add_object(sphere(y=5,x=5,z=5,radius=1,material=light(intensity=50))) %>%
render_scene(lookfrom=c(-3,4,10), fov=22,
lookat=c(0,-0.5,0),clamp_value=10)
#Round a blend of two objects
generate_ground(material=diffuse(checkercolor="grey20")) %>%
add_object(csg_object(csg_round(csg_combine(
csg_pyramid(x=-0.5,y=-0.99,z=1.5),
csg_pyramid(x=0.5,y=-0.99,z=2), operation="blend"), radius=0),
material=glossy(color="red"))) %>%
add_object(csg_object(csg_round(csg_combine(
csg_pyramid(x=-0.5,y=-0.79,z=-1.5),
csg_pyramid(x=0.5,y=-0.79,z=-1), operation="blend"), radius=0.2),
material=glossy(color="green"))) %>%
add_object(sphere(y=5,x=5,z=5,radius=1,material=light(intensity=50))) %>%
render_scene(lookfrom=c(-3,5,10), fov=22,
lookat=c(0,-0.5,0),clamp_value=10)
dev.copy(png, "csg_round融合空间体.png");dev.off()
网友评论