3D嵌套(Nesting)
来源:互联网 发布:北京大数据起薪 编辑:程序博客网 时间:2024/05/16 19:32
DisplayObject3D继承DisplayObjectContainer3D
Scene3D继承SceneObject3D,SceneObject3D继承DisplayObjectContainer3D
故DisplayObject3D有addChild()方法 可以当做容器使用 别忘了 它还有x y z 属性
下面是代码:一个sphere嵌套另一个sphere:一样是用模板创建的:
package {
import flash.events.Event;
import org.papervision3d.objects.primitives.Sphere;
import org.papervision3d.view.BasicView;
public class NestExample extends BasicView {
private var parentSphere:Sphere;
private var childSphere:Sphere;
public function NestExample() {
/* super.BasicView(width=640,height=480,scaleToStage(是否让viewPort3D视窗为舞台大小));
当想改变大小时可以用它
*/
/*
* @ author :夜梦惊魂
*/
stage.frameRate=40;
//下面只需定义3D对象, 在将其add到scene中
parentSphere=new Sphere(null,400,16,12);
childSphere=new Sphere(null,100,12,8);
//使两面都显示
parentSphere.material.doubleSided=true;
childSphere.material.doubleSided=true;
//添加
scene.addChild(parentSphere);
parentSphere.addChild(childSphere);
startRendering();//创建secne3D basicRenderEngine viewPort3D camera3D
}
// 重写 onRenderTick 及其 调用父类onRenderTick ;
override protected function onRenderTick(e:Event=null):void {
parentSphere.localRotationY+=1;//旋转轴
childSphere.localRotationY+=2;//旋转轴
super.onRenderTick();//开始渲染
}
}
}
- 3D嵌套(Nesting)
- 接口嵌套 Nesting interfaces
- 20070824CSS Nesting 嵌套
- 【SL学习】——嵌套元素(Nesting Elements)
- solr对嵌套(nesting)结构的支持
- [3]565. Array Nesting(Java)
- LPC2000中断嵌套设计 nesting of interrupts in LPC2000
- rails2 如何使用scaffold生成嵌套资源 nesting resource
- 第十五周:( LeetCode565) Array Nesting(c++)
- 多层嵌套的CSS 3D动画技术详解
- 多层嵌套的CSS 3D动画技术详解
- 5.2 Nesting
- File Nesting
- Array Nesting
- codility Nesting
- Array Nesting
- Array Nesting
- [C++]vector嵌套实现2D数组
- C语言中函数参数传递的方式。
- Installshield for VC++ 6.0
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Tomcat使用中必须了解的10个配置
- SQL标准
- 3D嵌套(Nesting)
- exit 与 return 的区别
- 继续摘抄:sendmail 的smpt验证
- C++之const
- 来个超级大模拟-----日期计算器
- 牟长青:浅谈如何提高网站PR值
- 继续摘抄:postfix最新源码病毒过滤和反垃圾实战篇
- 英语真变态
- 继续摘抄:POP / IMAP 服务器的构建( Dovecot )