lg3d.open(vrmlgen)
lg3d.open()所属R语言包:vrmlgen
Livegraphics3D output device system
Livegraphics3D输出设备系统
译者:生物统计家园网 机器人LoveR
描述----------Description----------
lg3d.open creates a new Livegraphics3D-environment in which primitive and higher-level plotting functions can be combined together to create a scene in the Livegraphics3D-format.
lg3d.open创建一个新的的Livegraphics3D环境中,原始的,更高级别的绘图功能可以结合在一起,创建一个场景中的Livegraphics3D格式。
用法----------Usage----------
lg3d.open(filename = "out.m", col = "white", scale = 1,
html.embed = "out.html", hwidth = 1200,
hheight = 800, ambientlight = 0.5)
参数----------Arguments----------
参数:filename
filename of the generated Livegraphics3D output file
所生成的Livegraphics3D输出文件的文件名
参数:col
background color
背景颜色
参数:scale
a scaling factor for the size of the entire 3D scene
整个三维场景的大小的比例因子
参数:html.embed
a filename for generating an HTML-file to embed the VRML-output
用于产生一个HTML文件的文件名嵌入的VRML输出
参数:hwidth
width of the embedded visualization in the HTML-output
在HTML输出宽度的嵌入式的可视化
参数:hheight
height of the embedded visualization in the HTML-output
嵌入式的可视化在HTML输出高度
参数:ambientlight
ambient light gray level (value between 0 and 1, LG3D only)
环境光的灰度级(0和1之间的值,只LG3D)
Details
详细信息----------Details----------
This function creates a new Livegraphics3D-environment to provide access to primitive plotting functions like points3d, lines3d and text3d and to combine multiple plotting functions together (both primitive and higher-level functions). After creating the environment, all primitive and higher-level functions called afterwards will automatically inherit the higher-level settings (background color, navigation-type, etc.) specified in the lg3d.open- parameters. In order to close the environment and create the plot, the lg3d.close() function has to be called.
此功能创建一个新Livegraphics3D,环境,提供访问原始的绘图功能,如points3d,lines3d和text3d,并结合多重绘图功能(原始的,更高级别的功能)。创造适当的环境后,所有原始的,更高级别的函数调用后会自动继承在的lg3d.open参数指定的较高级别的设置(背景颜色,导航型等)。为了接近环境和创建图,的lg3d.close()函数被调用。
值----------Value----------
The function is used for its side-effect (output of a Livegraphics3D-file in the specified directory) and has no return value. The htmlout-parameter can be used to embed the resulting Livegraphics3D-object in a template HTML-file.
该功能用于其副作用(输出的Livegraphics3D指定目录中的文件),并没有返回值。 htmlout参数在模板中的HTML文件可以用来嵌入所得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.close
vrml.close
实例----------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:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|