我正在尝试在 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