vrml.open(vrmlgen)
vrml.open()所属R语言包:vrmlgen
VRML output device system
VRML输出设备系统
译者:生物统计家园网 机器人LoveR
描述----------Description----------
vrml.open creates a new VRML-environment in which primitive and higher-level plotting functions can be combined together to create a 3D-VRML scene.
vrml.open创建一个新的VRML环境中,原始的,更高级别的绘图功能可以结合在一起,形成一个3D-VRML场景。
用法----------Usage----------
vrml.open(filename = "out.wrl", col = "white", navigation = NULL,
scale = 1, fov = 0.785, pos = rep(scale + 8, 3),
dir = c(0.19, 0.45, 0.87, 2.45),
html.embed = "out.html", hwidth = 1200, hheight = 800)
参数----------Arguments----------
参数:filename
filename of the generated VRML output file
VRML所生成的输出文件的文件名
参数:col
background color
背景颜色
参数:navigation
type of mouse navigation in the VRML file, can be "EXAMINE", "WALK", "SLIDE", "FLY" or "AN"
在VRML文件类型的鼠标导航,可以“检查”,“WALK”,“滑动”,“飞”或“PAN”
参数:scale
a scaling factor for the size of the entire 3D scene
整个三维场景的大小的比例因子
参数:fov
a scalar defining the field of view angle in the VRML file in radians
以弧度为单位定义的视野角在VRML文件的一个标量
参数:pos
a vector of size 3 corresponding to the position of the viewpoint
一个向量的大小为3的视点的位置对应于
参数:dir
a vector of size 4 specifying the viewing direction (first 3 components) and the rotation of the camera around the direction vector (last component in radians)
大小为4的矢量指定的观看方向(第3成分)和周围的方向矢量(以弧度为单位的最后一个组件的旋转的相机)
参数: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输出高度
Details
详细信息----------Details----------
This function creates a new VRML-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 VRML-environment, all primitive and higher-level functions called afterwards will automatically inherit the higher-level settings (background color, navigation-type, etc.) specified in the vrml.open-parameters. In order to close the VRML-environment and create the plot, the vrml.close() function has to be called.
这个函数创建了一个新VRML环境,提供获得原始的绘图功能,像points3d,lines3d和text3d并结合多重绘图功能(原始的,更高级别的功能)。创建VRML环境后,所有原始的,更高级别的函数调用后会自动继承在的vrml.open参数指定的较高级别的设置(背景颜色,导航型等)。为了关闭VRML环境和创建图,的vrml.close()函数被调用。
值----------Value----------
The function is used for its side-effect (output of a VRML-file in the specified directory) and has no return value. The htmlout-parameter can be used to embed the resulting VRML-object in a template HTML-file.
该功能用于其副作用(输出的VRML文件中指定的目录)并没有返回值。 htmlout参数可以用来嵌入所得VRML的对象在模板中的HTML文件。
(作者)----------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).[(原子对给定距离内的阈值)。]
vrml.open(file = "c60.wrl", navigation = "EXAMINE",
html.embed = "c60example.html")
# load dataset[负载数据集]
data(c60coords)
# plot the atoms as black spheres[绘制原子的黑球]
points3d(c60coords, col = "black")
# 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 = 1)
}
}
vrml.close()
# show the output in a web-browser [在Web浏览器中显示的输出]
# (VRML-plugin must be installed!)[(VRML插件必须安装!)]
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:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|