ivot3D =scene.addChildFromFile( "astronaut.f3d" )
ivot3D 是 Flare3D 中最基本的对象。 它与空影片剪辑相似,因为你可以对它进行移动、旋转和转换以及将其它 3D 对象添加到其中。如果现在你对项目进行编译,则你将看到一个小宇航员(astronaut)飞来飞去。 正如 addChildFromFile 方法的名称暗指的那样,它从一个外部资源将一个新的 child 添加到 scene,并且将该对象作为一个Pivot3D 容器返回。 在本范例中,该对象被称为宇航员(astronaut)。每个文件可以包含许多对象,其中包括几何图形、相机、灯光、等等。 因此,返回的对象本身不是 mesh,而是整个文件的一个容器。下面的代码可以建立相应的 Stage,创建相应的 scene 以及加载包含 3D 模型的 Flare3D 文件:// stage setup.stage.scaleMode = StageScaleMode.NO_SCALE;stage.align = StageAlign.TOP_LEFT;// In this first steps, just change the scene bycreating a Viewer3D// to be able to look around the scene.scene = new Viewer3D(this);// Loads the external files and stores thereferences into planet// and astronaut objects.planet = scene.addChildFromFile( "planet.f3d" );astronaut =scene.addChildFromFile( "astronaut.f3d" );//You can listen PROGRESS and COMPLETE events tocontrol scene loadingscene.addEventListener( Scene3D.PROGRESS_EVENT,progressEvent );scene.addEventListener( Scene3D.COMPLETE_EVENT,completeEvent );| 欢迎光临 纳金网 (http://go.narkii.com/club/) | Powered by Discuz! X2.5 |