DAE节点
日尧木艮 (2011-04-18 19:47:18)
不废话直接进主题,test1.DAE节点如下:
<library_visual_scenes>
<visual_scene id="RootNode" name="RootNode">
<node id="Cylinder01" name="Cylinder01">
<translate sid="translate">-60.147602 21.033211 0.000000</translate>
<instance_geometry url="#Cylinder01-lib">
<bind_material>
<technique_common>
<instance_material symbol="Map__2-Material" target="#Map__2-Material"/>
<instance_material symbol="Material__26" target="#Material__26"/>
</technique_common>
</bind_material>
</instance_geometry>
</node>
<node id="Cylinder02" name="Cylinder02">
<translate sid="translate">-85.042351 28.413282 60.535057</translate>
<instance_geometry url="#Cylinder02-lib">
<bind_material>
<technique_common>
<instance_material symbol="Map__1-Material" target="#Map__1-Material"/>
<instance_material symbol="Material__25" target="#Material__25"/>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</visual_scene>
</library_visual_scenes>
as3中的代码如下:
private var dae:DAE;
private var view:BasicView;
public function test():void {
init3DEngine();
init3DObject();
}
private function init3DEngine():void {
view = new BasicView(0, 0, true, true, "Target");
view.viewport.buttonMode = true;
this.addChild(view);
this.addEventListener(Event.ENTER_FRAME, onEvent3DClick);
}
private function init3DObject():void {
dae = new DAE();
dae.load("test1.DAE");
dae.scale = 2;
view.scene.addChild(dae);
}
private function onEvent3DClick(e:Event):void {
dae.rotationY += 2;
view.singleRender();
}
上面这个实例是2个圆柱体在场景中转动,现在的问题是:如何通过 RootNode 这个节点用getChildByName("")来控制上面个圆柱体转动 下面个不转动,请会的朋友帮忙解答下 ,谢谢^_^~