- 1、本文档共24页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
R绘图系统16课件
16.1
library(rgl)
tetra - function() {
t1 - tetrahedron3d()
t2vb - t1$vb
t2vb[1, ] - -3
t2 - tmesh3d(t2vb, t1$it)
plane - qmesh3d(rbind(rep(-3.01, 4),
c(-2, -2, 2, 2),
c(-3, 3, 3, -3),
rep(1, 4)),
matrix(1:4, ncol=1))
open3d(windowRect=c(0, 0, 600, 600))
# clear3d()
shade3d(plane, color=white, specular=black)
wire3d(plane)
wire3d(t1, lwd=3)
wire3d(t2, lwd=3)
segments3d(rbind(t2$vb[1, t2$it],
t1$vb[1, t1$it]),
rbind(t2$vb[2, t2$it],
t1$vb[2, t1$it]),
rbind(t2$vb[3, t2$it],
t1$vb[3, t1$it]),
col=gray, lwd=3)
view3d(40, -30)
}
t1 - cube3d()
t1tube - t1
t1tube$ib - t1tube$ib[, -(3:4)]
t2vb - t1$vb
t2vb[1, ] - -5
t2 - qmesh3d(t2vb, t1$ib)
plane - qmesh3d(rbind(rep(-5.01, 4),
c(-2, -2, 2, 2),
c(-3, 3, 3, -3),
rep(1, 4)),
matrix(1:4, ncol=1))
open3d(windowRect=c(0, 0, 600, 600))
# clear3d()
shade3d(plane, color=white,
ambient=white, specular=white, emission=white)
wire3d(plane)
shade3d(t1tube, color=white, specular=black)
wire3d(t1, lwd=3)
wire3d(t2, lwd=3)
segments3d(rbind(t2$vb[1, t2$ib[, 4]],
t1$vb[1, t1$ib[, 4]]),
rbind(t2$vb[2, t2$ib[, 4]],
t1$vb[2, t1$ib[, 4]]),
rbind(t2$vb[3, t2$ib[, 4]],
t1$vb[3, t1$ib[, 4]]),
col=gray, lwd=3)
view3d(55, -20, fov=0)
rgl.postscript(Figures/threed-3dproj.eps)
system(epstopdf Figures/threed-3dproj.eps)
system(convert Figures/threed-3dproj.pdf Web/threed-3dproj.png)
16.2
library(rgl)
tetra - function() {
t2vb - t1$vb
t2vb[1, ] - -3
t2vb[2, c(1, 4)] - t2vb[2, c(1, 4)]*.8
t2vb[3, c(1, 4)] - t2vb[3, c(1, 4)]*.8
t2vb[2, 2:3] - t2vb[2, 2:3]*.6
t2vb[3, 2:3] - t2vb[3, 2:3]*.6
t2 - tmesh3d(t2vb, t1$it)
t3vb - t1$vb
t3vb[1, ] - -10
t3vb[2, ] - 0
t3vb[3, ] - 0
t3 - tmesh3d(t3vb, t1$it)
open3d(win
文档评论(0)