【发布时间】:2012-05-24 19:22:15
【问题描述】:
我正在尝试在 Flash 中使用 CAST3D,当我执行代码时它给了我这个 错误 1046:找不到类型或不是编译时常量:Matrix3D。当我点击编译器错误时,它会将我带到 CAST3D 的动作脚本,它是这样的:
public function get local(): Matrix3D { return this.geomgroup.transform; }
我已经在 flash 中安装了 library.swc 文件。我是 Flash 新手。 这个问题有什么解决办法吗? 多谢 阿德里安·德巴罗
public function blenderModel()
{
setup3DScene();
}
private function setup3DScene(): void
{
this.setupSandy();
this.setupCast3D();
this.setupControls();
this.loadData();
this.addEventListener(Event.ENTER_FRAME, this.handleEnterFrame);
}
/**
* initial setup for Sandy3D.
*/
public function setupSandy(): void
{
// We create the camera
camera = new Camera3D( 600, 400 );
camera.near = 1;
// We create the "group" that is the tree of all the visible objects
var root:Group = new Group();
// We create a Scene and we add the camera and the objects tree
scene = new Scene3D( "scene", this, camera, root );
scene.light = new Light3D(new Vector(0,0,1),100);
}
/**
* initial setup for Cast3D.
*/
public function setupCast3D(): void
{
this.loaded = false;
this.animator = new Cast3d(this.scene, this.camera);
this.animator.animationType = Cast3d.ANIMATION_TYPE_BYFRAME; // ANIMATION_TYPE_REAL; //
this.animator.fps = 22;
this.animator.autoRewind = false;
}
/**
* Function setups visual animation control
【问题讨论】:
-
这是一个非常基本的 3D 引擎单元。请展示您如何创建场景/对象
-
我放了必要的代码我没有放负载和控制方法