美文网首页
R语言rayrender包,csg_plane表面变形

R语言rayrender包,csg_plane表面变形

作者: youmigo | 来源:发表于2021-07-30 23:18 被阅读0次
1.png 2.png 3.png

R语言rayrender包,csg_plane表面变形

# Wed Jun 16 01:04:47 2021 -

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

# csg_plane表面变形
csg_object(csg_plane(width_x=4, width_z=4), material=diffuse(checkercolor="purple")) %>%
  add_object(sphere(y=5,x=5,material=light(intensity=40))) %>%
  render_scene(clamp_value=10)

#Combine the plane with a sphere
csg_object(csg_combine(
  csg_sphere(radius=0.5),
  csg_plane(width_x=4, width_z=4,y=-0.5),
  operation="blend"),material=diffuse(checkercolor="purple")) %>%
  add_object(sphere(y=5,x=5,material=light(intensity=40))) %>%
  render_scene(clamp_value=10)

#Re-orient the plane using the normal and
csg_object(csg_combine(
  csg_sphere(radius=0.5),
  csg_plane(normal = c(1,1,0),width_x=4, width_z=4,y=-0.5),
  operation="blend"),material=diffuse(checkercolor="purple")) %>%
  add_object(sphere(y=5,x=5,material=light(intensity=40))) %>%
  render_scene(clamp_value=10)
# Wed Jun 16 01:05:15 2021 --
dev.copy(png, "3.png");dev.off()

相关文章

网友评论

      本文标题:R语言rayrender包,csg_plane表面变形

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