pv3d 2.0版本的一篇英文教程翻译 5 基础纹理

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();
  }
  }
  }
提供了基于BP(Back Propagation)神经网络结合PID(比例-积分-微分)控制策略的Simulink仿真模型。该模型旨在实现对杨艺所著论文《基于S函数的BP神经网络PID控制器及Simulink仿真》中的理论进行实践验证。在Matlab 2016b环境下开发,经过测试,确保能够正常运行,适合学习和研究神经网络在控制系统中的应用。 特点 集成BP神经网络:模型中集成了BP神经网络用于提升PID控制器的性能,使之能更好地适应复杂控制环境。 PID控制优化:利用神经网络的自学习能力,对传统的PID控制算法进行了智能调整,提高控制精度和稳定性。 S函数应用:展示了如何在Simulink中通过S函数嵌入MATLAB代码,实现BP神经网络的定制化逻辑。 兼容性说明:虽然开发于Matlab 2016b,但理论上兼容后续版本,可能会需要调整少量配置以适配不同版本的Matlab。 使用指南 环境要求:确保你的电脑上安装有Matlab 2016b或更高版本。 模型加载: 下载本仓库到本地。 在Matlab中打开.slx文件。 运行仿真: 调整模型参数前,请先熟悉各模块功能和输入输出设置。 运行整个模型,观察控制效果。 参数调整: 用户可以自由调节神经网络的层数、节点数以及PID控制器的参数,探索不同的控制性能。 学习和修改: 通过阅读模型中的注释和查阅相关文献,加深对BP神经网络与PID控制结合的理解。 如需修改S函数内的MATLAB代码,建议有一定的MATLAB编程基础
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值