lg3d.close(vrmlgen)
lg3d.close()所属R语言包:vrmlgen
Livegraphics3D output device system
Livegraphics3D输出设备系统
译者:生物统计家园网 机器人LoveR
描述----------Description----------
lg3d.close terminates a Livegraphics3D-environment and writes the corresponding 3D-scene to a Livegraphics3D-file.
lg3d.close终止一个Livegraphics3D环境,到Livegraphics3D文件,并写入相应的3D场景。
用法----------Usage----------
lg3d.close()
Details
详细信息----------Details----------
This function closes a Livegraphics3D-environment created with lg3d.open() and writes the Livegraphics3D-plot to the file and directory specified in the lg3d.open- parameters. For more details, see the description of the lg3d.open- function.
此函数关闭Livegraphics3D的环境中建立与lg3d.open(),,并写入的Livegraphics3D图在lg3d.open参数到指定的文件和目录。有关详细信息,请参阅的描述的lg3d.open功能。
值----------Value----------
The function is used for its side-effect (output of a Livegraphics3D-file in the specified directory) and has no return value.
该功能用于其副作用(输出的Livegraphics3D指定目录中的文件),并没有返回值。
(作者)----------Author(s)----------
Enrico Glaab
参考文献----------References----------
3D Data Visualization on the Web. Journal of Statistical Software, 36(8), p. 1-18. URL: http://www.jstatsoft.org/v36/i08/
参见----------See Also----------
vrml.open
vrml.open
实例----------Examples----------
curdir <- getwd()
outdir <- tempdir()
setwd(outdir)
# This example loads the atom coordinates of a molecule[例如加载一个分子的原子坐标]
# (C60, fullerene) and visualizes the molecule in 3D[富勒烯(C60,富勒烯)和在3D可视化的分子]
# using points for the atoms and lines for the atom bonds[使用点的原子和原子的线]
# (atom pairs within a given distance threshold).[(原子对给定距离内的阈值)。]
lg3d.open(file = "c60.mat", html.embed = "c60example.html")
# load dataset[负载数据集]
data(c60coords)
# plot the atoms as black spheres[绘制原子的黑球]
points3d(c60coords, col = "black", scale = 2)
# plot the atom bonds as gray lines[灰线绘制原子]
# (for all atom pairs with a Euclidean distance < 0.66)[(所有原子对一个欧氏距离<0.66)]
for(j in 1nrow(c60coords)-1))
{
for(k in (j+1):nrow(c60coords))
{
if(sqrt(sum((c60coords[j,]-c60coords[k,])^2)) < 0.66)
lines3d(c60coords[c(j,k),], col = "gray", lwd = 2)
}
}
lg3d.close()
# show the output in a web-browser [在Web浏览器中显示的输出]
# (Java must be enabled!)[(Java必须启用!)]
if(file.exists(paste("file://",file.path(outdir,
"c60example.html"), sep = "")))
{
browseURL(paste("file://",file.path(outdir,
"c60example.html"), sep = ""))
}
setwd(curdir)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|