这是关于3D基本元素的第三篇教程也是最后一篇。在这篇里要介绍的是我们不常用到的。GridPlane和LineSegment用于调试,然而Cone, Torus 和SeaTurtle更是“非必备品”了。

这篇教程里介绍过的3D基本元素也存在于别的3D引擎或模型包里。由于不常用,本教程里没有像前两节里那样丰富的实例。不过这里还是提供了能展现其用法的代码

先决条件

本教程建立在我们别的教程基础之上。假如你是flash3D菜鸟,你可能会先要去看看这些教程。举个例子,有些源文件,点击附带的as文件查看它们是如何工作的。所有这些例子都要用到一个Cover.as文件。这个文件是让教程里用到的flash影片不能同时工作,否则会拖垮你的电脑。如果你不确定如何使用这些例子,查看这个教程。

教程里的一部分例子会用到“纹理”。关于纹理与材质我们会在后边教程详细介绍,如果要让代码在flash cs3里工作, 读这个教程.

The Cone

圆锥用处不大。做冰淇淋甜筒、锥形交通标和宴会帽等效果时可能会用到。圆锥有radius、segmentsH、segmentsW和height属性,另外一个属性用于指明是否开口,如果设为开口,我们就可以从圆锥底看到圆锥内部。

Swf:点击观看as: Basic08_cone.as

在本例展示了几种可能.下载源文件,看看各类属性如何设置。

The Cylinder

圆柱体与圆锥提供的属性大多相同,看下例:

Swf:点击观看as: Basic08_cylinder.as

圆柱体可能要比圆锥有用的多,不过用它要付出“昂贵”的代价。记得winxp经典屏保—管道实时渲染吗?这个看上去很容易实现,但实际上用3D引擎很难实现这个效果。像前面的例子里看到的那样,要让一个3D元素显示的很“圆”就需要大量的三角形,圆柱体也不例外。回顾历史我们不难发现在游戏里大量使用“圆形表面”还只是近几年的事。

The GeodesicSphere

A Geodesic sphere is most commonly referred to as a Geodesic Dome. It's been used in building construction (see Spaceship Earth at Epcot) and has some unique properties when compared to a traditional Sphere primitive. In Away3D the Geodesic Sphere starts off with a basic shape that looks like 2 pyramids combined. This shape is then refined by triangulating each of the triangles in the basic shape to approximate a sphere.

The higher amount of triangulation, the more round the sphere will appear. In the image below, the fracture setting is noted next to each sphere so you can see how this affects the roundness of the sphere.

as: Basic08_geodesicsphere_refine.as

As you see from the image, this is a quite different way to build the sphere than with a normal sphere primitive. The triangles are almost the same size across the object and this makes a GeodesicSphere more round than a sphere, given the same number of triangles. Mouse over the example below to see how the two compare.

Swf:点击观看as: Basic08_geodesicsphere.as

It is also possible to create a Geodesic sphere based on other primitives as this code shows.

The RoundedCube

圆角立方体只在Away3D引擎里有。最简单的圆角立方体看上去就像个球。通过增加三角形面数可以得到更佳的效果

点此去浏览Fabrice Closier的博客。FabriceAway3D开发团队里核心成员。

这个基本元素还是最近在用户的要求下添加的。假如你需要一种Away3D里还没有的3D元素,你可以试图在away3D论坛里发帖。论坛会员就有可能去开发这个元素,当然如果你也有开发能力也欢迎您把代码投稿到away3D引擎。

The SeaTurtle

This was the first output of the as3 exporter, a class that can generate a compact AS3 class based on any loaded model. This class has since been updated a lot and it's very powerful. If you want a compact 3D project, you should consider testing how the AS3 exporter can improve both file size and load times. While not really a primitive, the Sea Turtle was a fun addition and a bit of a mascot in the early days of Away3D. Since it's kind of complex and has a lot of faces, it is also useful for testing lighting. The texture for the turtle is located in the "/techdemos/images/" folder that you can download from the Away3D subversion repository. You'll see it in use in the next primitive - the GridPlane.

The GridPlane

网格平面这个3D元素用于辅助建立场景。它只是带网格的平面,但它成为大多3D程序里必备部分是有原因的。看下面模型。

Swf:点击观看 as: Basic08_gridplane.as image: seaturtle.jpg

如上添加了三叉戟与网格后,你对该场景个位置情况一目了然。

The Torus

圆环存在于大多3D工具里。它可用于油炸圈饼、救生圈。同时这个也用于测试阴影。应用模拟光反射、阴影于旋转的圆环上,圆环看上去效果很不错。

Swf:点击观看 movie: Basic08_torus.as, images: doughnut.jpg mandelbrot.jpg marble.jpg

注意圆环不用segmentsW 和segmentsH设置,取而代之的是segmentsR 和 segmentsT:

torus.segmentsR = 20;torus.segmentsT = 10;

The LineSegment

像下面例子一样,有时候我们只需要在两点间画一根线。在away3D里提供了”线段“元素。把鼠标移到下面影片上,我们可以看到一根线段始总连着”海龟“

Swf:点击观看as:Basic08_linesegment.as, image: seaturtle.jpg

The Wire primitives

Several of the primitives are also available in Wireframe version. They have no surface so you can see the mesh they consist of.

A final note

As said initially, these primitives have very limited use and some of them even contain bugs. While working on this tutorial, I've added these bugs to the issue list for Away3D. Most notably - the cone and geodesic sphere has texture issues, the cylinder becomes too long if you use more than one segment. The issues are reported to the team and will probably be fixed swiftly, but I'm adding it here as a "nice to know" thing.

转载于:https://www.cnblogs.com/nooon/archive/2009/05/17/1458662.html

Away3D 基础5 - 3D基本元素(3)相关推荐

  1. 零基础学习3D建模,第一步:3D建模软件有哪些?给你科普一下

    1.建模软件有很多,为大家科普下建模软件有哪些: 高模:Maya.3Dmax.Zbrush 中模:Maya.3Dmax 低模:Maya.3Dmax.Topogun 展UV:Maya.Zbrush.Un ...

  2. 零基础学3D建模,应该怎么开始学?你需要注意这些!

    丑化说在前头,如果想真正学好3D建模,需要花费很多时间和功夫,不要想着轻松也不要想着一蹴而就,如果只是三分钟热度,不如趁早放弃,这些话不仅仅针对于3D建模的学习,任何专业技能的学习都一样. 面对陌生的 ...

  3. 零基础入门3D游戏建模师知识必备

    入门3D游戏建模师 随着国内游戏市场的蓬勃发展,行业对于游戏建模的需求在不断增加,相信很多想要进入游戏行业的小伙伴,想做3D游戏建模师,又不知道该如何去做,今天小编就带大家聊一聊关于零基础入门建模须要 ...

  4. 零基础学3D游戏建模需要多久?

    如果你是零基础,需要一个完整的3D建模课程设计,一个好的课程设计大致应该包含以下4个方面的内容: 1.一个月基础课学习,提升美术实力. 虽然零基础可以学习3D建模,并不代表着可以不重视基础.所以我们学 ...

  5. 零基础学3D建模一般要多久?

    零基础学3D次世代建模到入门,根据每个人的吸收能力,基本需要6-9个月的时间. 6-9个月是那种集训,周一到周五,每天12个小时以上的练习量. 我们的零基础次世代建模课程是7个月的时间,7(月)*4( ...

  6. 做3d建模的工作工资是不是很高?从零基础学习3D建模到学成功,需要多久?

    关于3D建模,尤其是3D游戏建模这一块,希望能够解决大家思想上困扰,对未来的迷茫,找准自己的方向,谁的青春不迷茫,可谁不想让自己的青春绽放? 建模福利领取: 如果你想自己制作游戏动漫模型,这里专门建立 ...

  7. 做笔记,零基础学3D建模快速方法

    多数想要学习3D建模的同学在刚刚开始学的时候,都会放下豪言壮语:我一定会通过这些视频教程和书自学成功. 随后通常半个月以后再聊到3D建模的自学情况时,往往普遍多数的同学都会不好意思的回答:哎,老师,别 ...

  8. Away3D:《Flash 3D基础向导》已出版

    下载 (49.97 KB) 昨天 10:57 比实际上市日期稍晚的公告--因为当时我正在悉尼那边培训 Away3D客.无论如何我们现在有了第一个Away3D出版物了! 这对于参与其中的人们是个繁琐的工 ...

  9. Away3D基础之摄像机

    原英文地址:http://www.flashmagazine.com/Tutorials/detail/away3d_basics_the_cameras/ 翻译原文地址:http://blog.cs ...

最新文章

  1. 消息队列面试经典十连问
  2. goland 调试运行路径
  3. Cable:360实现的新虚拟网络架构
  4. 不再有神的概念,将所有存在称之为文明,这很有意思
  5. 爬虫篇 | 快速入门selenium(十一)
  6. Day 1 二分搜索训练总结
  7. iOS下载大文件原理解析一
  8. python控制其它软件_从另一个脚本控制python脚本
  9. mousemove事件java,three.js,补间相机和mousemove事件
  10. 一个空间配置多个虚拟主机
  11. 在Magento首页显示新产品怎么设置
  12. air写文件 SecurityError: fileWriteResource 时报错的解决方法
  13. 在VB.NET中初始化网格实现方法知识讲解
  14. sql注入------基于时间延迟benchmark函数注入脚本
  15. C++ OpenCV 开发笔记整理分类合集【所有的相关记录,都整理在此】
  16. 可以上传、下载文件的SSH客户端软件--SecureCRT绿色版
  17. Windows10安装韩语输入法详细教程(图文)
  18. Problem : 美丽黄山II
  19. 制作FlappyBird时出现的一些问题
  20. Excel应用-使用VBA自动绘制所有适用类型的Excel图表(代码及效果图)

热门文章

  1. spring注解驱动开发-7 Spring声明式事务
  2. ardino 不用舵机控制板直接控制六自由度机械臂
  3. iOS推送语音播报(类似支付宝收款提醒)
  4. 关于C++的动态内存分配
  5. 基于tiva的匿名飞控学习笔记(1)
  6. 计算机软件发展四十五年
  7. D3.js 饼状图的制作
  8. 《白话大数据与机器学习》读书笔记2
  9. 【简历优化】项目经验问什么怎么写怎么答
  10. 编译错误error: invalid storage class