美文网首页
R语言rayrender包,csg_rounded_cone水滴

R语言rayrender包,csg_rounded_cone水滴

作者: youmigo | 来源:发表于2021-08-02 19:31 被阅读0次

R语言rayrender包,csg_rounded_cone水滴体

0.png 1.png
# Thu Jun 17 01:38:13 2021 -

# 字符编码:UTF-8
# R 版本:R x64 4.1 for window 10
# cgh163email@163.com
# 个人笔记不负责任,拎了个梨🍐🌷
.rs.restartR()
require(rayrender)
rm(list = ls());gc()

# csg_rounded_cone水滴体
generate_ground(material=diffuse(checkercolor="grey20")) %>%
  add_object(csg_object(csg_rounded_cone(),material=glossy(color="red"))) %>%
  render_scene(clamp_value=10,fov=20)

#Change the orientation by specifying a start and end
generate_ground(material=diffuse(color="dodgerblue4",checkercolor="grey10")) %>%
  add_object(csg_object(csg_rounded_cone(start = c(-1,0.5,-2), end = c(1,0.5,-2),
                                         radius=0.5),material=glossy(checkercolor="red"))) %>%
  render_scene(clamp_value=10,fov=20,
               lookat=c(0,0.5,-2),lookfrom=c(3,3,10))

#Show the effect of changing the radius
generate_ground(material=diffuse(color="dodgerblue4",checkercolor="grey10")) %>%
  add_object(csg_object(
    csg_combine(
      csg_rounded_cone(start = c(-1,0.5,-2), end = c(1,0.5,-2), radius=0.5),
      csg_rounded_cone(start = c(-0.5,1.5,-2), end = c(0.5,1.5,-2), radius=0.2,upper_radius = 0.5)),
    material=glossy(checkercolor="red"))) %>%
  render_scene(clamp_value=10,fov=20,
               lookat=c(0,0.5,-2),lookfrom=c(-3,3,10))
dev.copy(png, "0.png");dev.off()

相关文章

网友评论

      本文标题:R语言rayrender包,csg_rounded_cone水滴

      本文链接:https://www.haomeiwen.com/subject/qdeqyltx.html