- 最后登录
- 2013-6-5
- 注册时间
- 2011-12-3
- 阅读权限
- 90
- 积分
- 6206
![Rank: 6](static/image/common//star_level3.gif) ![Rank: 6](static/image/common//star_level2.gif)
- 纳金币
- 6206
- 精华
- 0
|
本节通过一个稍微有点难度的范例,来总结复习前面学过的知识。
请先看如下圆柱体的渲染代码:
<Shape>
<Appearance><Material/>
<ImageTexture
url="2.png"/>
</Appearance><Cylinder
bottom="false" height="3.2" side="false"/>
</Shape>
<Shape>
<Appearance><Material/>
<ImageTexture
url="3.png"/>
</Appearance><Cylinder
height="3.2" side="false" top="false"/>
</Shape>
<Shape>
<Appearance><Material/>
<ImageTexture
url="1.jpg"/>
</Appearance><Cylinder
bottom="false" height="3.2" top="false"/>
</Shape>
上面的程序示例中的三段分别用三个贴图文件来修饰顶部,侧面和底部。请注意在其中是如何通过顶部、底部和侧面的开关值变化来控制贴图位置的。
相对来说圆球则显得简单多了:
<Shape>
<Appearance>
<ImageTexture
url="2.jpg" />
</Appearance>
<Sphere />
</Shape>
|
|