你好,欢迎来到电脑编程技巧与维护杂志社! 杂志社简介广告服务读者反馈编程社区  
合订本订阅
 
 
您的位置:杂志经典 / 跟高手学编程
1.10 X3D三维立体场景设计(下)
 

<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-browserBS Contact VRML-X3D浏览器,然后打开“X3D源程序实例/px3d2.x3d”,即可运行虚拟现实X3D天有不测风云三维立体场景造型,如图7所示。

 


 

7  天有不测风云三维立体造型效果图

 

五、结语

本文讲述对虚拟现实X3D三维立体造型节点开发设计有了进一步了解,通过创建三维立体场景和造型,熟悉立体几何节点Sphere球体节点、Box盒子节点、Cone圆锥体节点以及Cylinder圆柱体节点等。利用X3D立体几何节点创建的造型编程简洁、快速、方便,有利于浏览器的快速浏览,提高软件编程和运行的效率,并结合实例源程序理解软件开发与设计全过程。

虚拟现实X3D几何三维立体节点主要由Shape模型节点、三维立体造型节点以及相关几何节点组成。利用3D三维立体几何节点创建三维几何造型,也可以创建实体模型,还可以对其进行着色。Shape模型节点由Appearance外观节点和几何节点构成。Appearance外观子节点定义了物体造型的外观,包括纹理映像、纹理坐标变换以及外观的材料节点,Geometry几何造型子节点定义了立体空间物体的几何造型。

掌握虚拟现实X3D三维立体几何场景和造型开发与设计,掌握基本编程思想、方法和手段,为今后学习打下良好基础。

 

 

  推荐精品文章

·2024年12月目录 
·2024年11月目录 
·2024年10月目录 
·2024年9月目录 
·2024年8月目录 
·2024年7月目录 
·2024年6月目录 
·2024年5月目录 
·2024年4月目录 
·2024年3月目录 
·2024年2月目录 
·2024年1月目录
·2023年12月目录
·2023年11月目录

  联系方式
TEL:010-82561037
Fax: 010-82561614
QQ: 100164630
Mail:gaojian@comprg.com.cn

  友情链接
 
Copyright 2001-2010, www.comprg.com.cn, All Rights Reserved
京ICP备14022230号-1,电话/传真:010-82561037 82561614 ,Mail:gaojian@comprg.com.cn
地址:北京市海淀区远大路20号宝蓝大厦E座704,邮编:100089