美文网首页
R语言rayrender包,mesh3d_model文件和对象m

R语言rayrender包,mesh3d_model文件和对象m

作者: youmigo | 来源:发表于2021-08-22 15:22 被阅读0次

R语言rayrender包,mesh3d_model文件和对象mesh3d”模式

# Thu Jul 01 01:59:02 2021 -

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

?   mesh3d_model    #   mesh3d”模式
#加载mesh3d对象(从Rvcg)并渲染:


  library(Rvcg)

  data(humface)
rgl::  shade3d(humface)

  generate_studio() %>%
    add_object(mesh3d_model(
      humface,
      y = -0.3,
      x = 0,
      z = 0,
      material = glossy(color = "dodgerblue4"),
      scale_mesh = 1 / 70
    )) %>%
    add_object(sphere(
      y = 5,
      x = 5,
      z = 5,
      material = light(intensity = 50)
    )) %>%
    render_scene(
      samples = 500,
      width = 800,
      height = 800,
      lookat = c(0, 0.5, 1),
      aperture = 0.0
    )
kittyR::meowR(sound = 4)#猫叫

image.png
image.png

相关文章

网友评论

      本文标题:R语言rayrender包,mesh3d_model文件和对象m

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