<Shape>
<Appearance>
<Material ambientIntensity='0.4' diffuseColor='0.3 0.2 0' shininess='0.2' specularColor='0.7 0.7 0.6'>
</Material>
</Appearance>
<Sphere radius='1'>
</Sphere>
</Shape>
</Transform>
<Transform scale='0.5 0.2 0.5' translation='0 0 0'>
<Shape>
<Appearance>
<Material ambientIntensity='0.4' diffuseColor='0.3 0.2 0' shininess='0.2' specularColor='0.7 0.7 0.6'>
</Material>
</Appearance>
<Sphere radius='1'>
</Sphere>
</Shape>
</Transform>
<Transform scale='0.5 0.2 0.5' translation='0 -0.4 0'>
<Shape>
<Appearance>
<Material ambientIntensity='0.4' diffuseColor='0.3 0.2 0' shininess='0.2' specularColor='0.7 0.7 0.6'>
</Material>
</Appearance>
<Sphere radius='1'>
</Sphere>
</Shape>
</Transform>
<Transform scale='0.5 0.2 0.5' translation='0 -0.8 0'>
<Shape>
<Appearance>
<Material ambientIntensity='0.4' diffuseColor='0.3 0.2 0' shininess='0.2' specularColor='0.7 0.7 0.6'>
</Material>
</Appearance>
<Sphere radius='1'>
</Sphere>
</Shape>
</Transform>
<Transform scale='0.5 0.2 0.5' translation='0 -1.2 0'>
<Shape>
<Appearance>
<Material ambientIntensity='0.4' diffuseColor='0.3 0.2 0' shininess='0.2' specularColor='0.7 0.7 0.6'>
</Material>
</Appearance>
<Sphere radius='1'>
</Sphere>
</Shape>
</Transform>
<Transform scale='0.5 0.2 0.5' translation='0 1 0'>
<Shape>
<Appearance>
<Material ambientIntensity='0.4' diffuseColor='0.3 0.2 0' shininess='0.2' specularColor='0.7 0.7 0.6'>
</Material>
</Appearance>
<Sphere radius='1'>
</Sphere>
</Shape>
</Transform>
</Transform>
<Transform translation='-4.4 0 0'>
<Transform USE="pole"/>
</Transform>
<Transform translation='-3.3 0 0'>
<Transform USE="pole"/>
</Transform>
<Transform translation='-2.2 0 0'>
<Transform USE="pole"/>
</Transform>
<Transform translation='-1.1 0 0'>
<Transform USE="pole"/>
</Transform>
<Transform translation='1.1 0 0'>
<Transform USE="pole"/>
</Transform>
<Transform translation='2.2 0 0'>
<Transform USE="pole"/>
</Transform>
<Transform translation='3.3 0 0'>
<Transform USE="pole"/>
</Transform>
<Transform translation='4.4 0 0'>
<Transform USE="pole"/>
</Transform>
</Scene>
</X3D>
天有不测风云场景造型运行程序。首先,启动xj3d-browser或BS Contact VRML-X3D浏览器,然后打开“X3D源程序实例/px3d2.x3d”,即可运行虚拟现实X3D天有不测风云三维立体场景造型,如图7所示。

图7 天有不测风云三维立体造型效果图
五、结语
本文讲述对虚拟现实X3D三维立体造型节点开发设计有了进一步了解,通过创建三维立体场景和造型,熟悉立体几何节点Sphere球体节点、Box盒子节点、Cone圆锥体节点以及Cylinder圆柱体节点等。利用X3D立体几何节点创建的造型编程简洁、快速、方便,有利于浏览器的快速浏览,提高软件编程和运行的效率,并结合实例源程序理解软件开发与设计全过程。
虚拟现实X3D几何三维立体节点主要由Shape模型节点、三维立体造型节点以及相关几何节点组成。利用3D三维立体几何节点创建三维几何造型,也可以创建实体模型,还可以对其进行着色。Shape模型节点由Appearance外观节点和几何节点构成。Appearance外观子节点定义了物体造型的外观,包括纹理映像、纹理坐标变换以及外观的材料节点,Geometry几何造型子节点定义了立体空间物体的几何造型。
掌握虚拟现实X3D三维立体几何场景和造型开发与设计,掌握基本编程思想、方法和手段,为今后学习打下良好基础。
|