pv3d 2.0版本的一篇英文教程翻译 5 基础纹理
2009年12月21日
http://papervision2.com/5-basic-texturing/ 将用到得文件请这里下载
5 基础纹理
原文:Before starting this tutorial, please note that it follows on from Tutorial 4 - Basic Template Usage. If you haven't followed that tutorial, I suggest that you do so.
Be modifying a few lines, we're going to give our spinning cone a texture. The result will be something like this:
翻译:在开始这个教程前,请注意它是第4片教程的继续,基础模板使用方法。如果你没有看过那篇教程,我建议你去看一看。
通过修改几行代码,我们将给我们的旋转椎体一个纹理。结果大约如下。(源地址是flash 这里使用的截图。)
原文:Firstly, open up the project that you made in tutorial 4. I'm going to show you how to use the BitmapFileMaterial, so before we start, you need to import org.papervision3d.materials.BitmapFileMaterial. To do this, find where you have two lines starting with import and just below them, add the line:
翻译:首先,打开你在第四篇教程创建的项目,我将演示如何使用"BitmapFileMaterial"。那么在我们开始前,你需要导入BitmapFileMaterial类,要这样做,你得找到以"import"开头的两行,然则在他们下面添加:
import org.papervision3d.materials.BitmapFileMaterial;
原文:That line will import the BitmapFileMaterial package into your project, so that you can use it.
翻译:这一行将导入BitmapFileMaterial 包到你的项目中,这样你就可以使用它了。
原文:Now, we need to add a BitmapFileMaterial to our cone. We can do this when we create it, but first I'll explain BitmapFileMaterial.
翻译:现在,我们需要添加BitmapFileMaterial 到我们的圆锥。我们可以在创建它的时候做添加。但是,首先我要讲解一下BitmapFileMaterial.这个类。
原文:BitmapFileMaterial is a papervision 3d material which takes a url of an image file, and creates a texture from it. This is very useful when loading collada models, and it opens possibilities of having things like user-uploaded textures.
翻译:BitmapFileMaterial 是一种 papervision 3d 材质,它包含图片文件的url路径,用这个图片创建纹理。当我们加载collada(拉风?)模型时它是非常有用的,而且它使用户上传纹理成为可能。
原文:When you create a new BitmapFileMaterial object, you pass it a URL from which the texture will be fetched.
翻译:当你创建了一个新的BitmapFileMaterial对象,你传递给它一个url地址,你创建的对象将从这个地址获得一个相应的纹理。
原文:To add the material to our cone, we're going to pass a BitmapFileMaterial object to the cone when we create it. This is really simple to do, simply change the line:
翻译:要给我们的圆锥添加材质,我们将在创建它的时候赋予它一个BitmapFileMaterial 材质对象,这很简单,仅仅修改这一行:
public var cone:Cone = new Cone();
to:
public var cone:Cone = new Cone(new BitmapFileMaterial("http://papervision2.com/wp-content/downloads/ourtex.jpg" ));
原文:This will now get the file from my server and use it as the texture on your cone.
翻译:这样将从我的服务器获取文件,并将它作为纹理使用在你的圆锥上。
原文:Now, when you run your code you'll see the red and white texture on your cone. Simple!
翻译:现在,当你运行你的代码,你会看到红白相间的纹理在你的圆锥上。非常简单。
My final code looks like this:
package {
import PaperBase;
import org.papervision3d.objects.primitives.Cone;
import org.papervision3d.materials.BitmapFileMaterial;
public class Main extends PaperBase {
public var cone:Cone = new Cone(new BitmapFileMaterial("http://papervision2.com/wp-content/downloads/ourtex.jpg"), 20, 200);
// I've added a width and height to change the shape of my cone.
public function Main() {
init();
}
override protected function init3d():void {
cone.scale = 3;
cone.pitch( -30);
default_scene.addChild(cone);
}
override protected function processFrame():void {
cone.yaw(20);
// Here, I've made my cone spin faster by increasing the amount sent to yaw();
}
}
}
发表评论
-
编译 boost
2012-01-20 00:30 521编译 boost 2011年05月17日 ... -
[转]如何把一个Windows Phone 7 Twitter应用转换成新浪微博客户端
2012-01-20 00:30 345[转]如何把一个Windows Phone 7 Twitter ... -
《Windows核心编程》第一章 读书笔记
2012-01-20 00:29 582《Windows核心编程》第一章 读书笔记 2010年06月 ... -
在windows xp下编译WebKit
2012-01-20 00:29 726在windows xp下编译WebKit 2010年10月2 ... -
Symbian OS S60三种开发环境的搭建,基于C++
2012-01-20 00:29 609Symbian OS S60三种开发环境的搭建,基于C++ ... -
计算机4级5.31---6。30
2012-01-19 01:27 523计算机4级5.31---6。30 2010年06月14日 ... -
多线程和多进程的区别
2012-01-19 01:27 706多线程和多进程的区别 2010年07月20日 很想写点关 ... -
多线程和多进程的区别(小结
2012-01-19 01:27 757多线程和多进程的区别(小结 2011年09月18日 多线 ... -
7月16号 键盘按键失灵? 蓝屏的终极处理?
2012-01-19 01:27 8357月16号 键盘按键失灵? 蓝屏的终极处理? 2011年07 ... -
如何培养一年级学生良好的学习习惯
2012-01-19 01:27 645如何培养一年级学生良好的学习习惯 2011年06月28日 ... -
毕生精力总结的电脑技巧。。
2012-01-17 00:43 388毕生精力总结的电脑技巧。。 2011年10月03日 声 ... -
Android基础知识~入门进阶,一步步走到高手
2012-01-17 00:43 593Android基础知识~入门进 ... -
android linux 基础知识总结(789)
2012-01-17 00:43 403android linux 基础知识总结(789) 2011 ... -
Java Me--丰富多彩的领域中生机勃勃的技术
2012-01-17 00:43 613Java Me--丰富多彩的领域 ... -
一步步安装原版雪豹10.6.3-10.6.6
2012-01-17 00:43 1954一步步安装原版雪豹10.6 ... -
系统调用、POSIX、C库、系统命令和内核函数
2012-01-15 19:32 731系统调用、POSIX、C库、 ... -
papervision3D介绍及入门
2012-01-15 19:32 481papervision3D介绍及入门 2009年11月27日 ... -
Away3D Lite:Others
2012-01-15 19:32 970Away3D Lite:Others 2010年01月05日 ... -
Away3D Lite:ExMD2Cubic
2012-01-15 19:32 659Away3D Lite:ExMD2Cubic 2010年01 ...
相关推荐
flex 与 pv3d结合的例子 使用者请自pv3d2.0 版本的swc包 导入使用
pv3d flash 3d源码 pv3d flash 3d源码 pv3d flash 3d源码
Papervision3D 2.0文件和源代码
本软件PV3D是一个很著名的Flash 3D免费开源引擎,功能很强大,效率也可以。官方网站是http://www.papervision3d.org/,源代码下载地址是http://code.google.com/p/papervision3d/。目前最新版本是2.0a(Greate White)...
PV3D是流行的Flash3D技术,该资料包含了很多PV3D的资料,主要是学习的文档,还包括源码。
pv3d开发包,想学pv3d的朋友一定要下的工具包
pv3d简单全景,一个非常简单的pv3d全景图。
pv3d hlep 英文 chm格式 API帮助文档
pv3d开发工具as3 编写的pv3d开发工具as3 编写的pv3d开发工具as3 编写的pv3d开发工具as3 编写的
PV3D官网的展示:海底世界http://www.papervision3d.org/
开源3d引擎 pv3d源文件(AS3.0版)及demo.rar 开源3d引擎 pv3d源文件(AS3.0版)及demo.rar
使用PV3D编写的太阳系,同时添加了鼠标事件处理,当鼠标移动到地球的时候,地球会停止旋转,鼠标移开继续旋转
flash as3 3D开发引擎pv3D
pv3d 较精简版本,古董级的版本已经很难找到了,在这里发布一个供大家学习使用。
PV3D-GreatWhite-DOC. chm格式的pv3d api说明。
是我打包好的PV3D的SWC、AS文件和英文API,相信大家都会用到。
examples in pv3d 关于pv3d安装,简单运用的各种小实例,适合初学者
pv3d网上搜的资料 供大家享用吧,pv3d是一款很有用的3d引擎,非常厉害
这里是1.5版和1.7版的Papervision3D源码,做3d效果的时候用到的最新包
Papervision3D Essentials学习笔记