R語言rayrender包,csg_rounded_cone水滴體

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()

?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容