我在搅拌机(2.5)中创建了一个立方体并应用了材料和纹理。但是当我将该模型导入 Papervision 3d (2.1) 时,我什么也看不到 - 只是一个空白屏幕。另一方面,如果我使用任何其他 .dae 模型(例如,我指的是 Papervision3D Essentials 书籍,所以我使用了这些示例),那么我可以看到该模型。有什么问题?为什么我从搅拌机导出的模型不起作用?
这是我的脚本:
package {
import flash.events.Event;
import org.papervision3d.events.FileLoadEvent;
import org.papervision3d.events.InteractiveScene3DEvent;
import org.papervision3d.materials.BitmapMaterial;
import org.papervision3d.materials.ColorMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.objects.parsers.DAE;
import org.papervision3d.view.BasicView;
import org.papervision3d.objects.parsers.Collada;
public class modelTest extends BasicView
{
private var model:DisplayObject3D;
private var distance:Number = 1000;
private var speed:Number = 0.2;
private var rangeX:Number = 0.02;
private var rangeY:Number = 0.02;
private var rangeZ:Number = 0.05;
private var targetRotationX:Number = 0;
public function modelTest()
{
stage.frameRate = 40;
init();
startRendering();
}
private function init():void
{
model = new DAE();
DAE(model).load("assets/cube.dae");
scene.addChild(model);
viewport.interactive = true;
model.addEventListener(FileLoadEvent.LOAD_COMPLETE, modelLoaded);
}
private function modelLoaded(e:FileLoadEvent):void
{
trace("Used materials by this model: " + model.materials);
true).addEventListener(InteractiveScene3DEvent.OBJECT_CLICK, click);
}
override protected function onRenderTick(e:Event=null):void
{
super.onRenderTick();
}
}
}
这是输出:
INFO: Papervision3D 2.1 rev920 (August 11th, 2009)
INFO: Viewport autoScaleToStage : Papervision has changed the Stage scale mode.
INFO: DisplayObject3D: COLLADA_Scene
INFO: DisplayObject3D: Cube
INFO: DisplayObject3D: Lamp
INFO: DisplayObject3D: Camera
Used materials by this model: Material_001-material
搅拌机文件:http: //imageedit.netai.net/cube.blend
DAE 文件:http: //imageedit.netai.net/cube.dae