ActionScript 3 Papervision3D Collada Parser示例

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 Papervision3D Collada Parser示例相关的知识,希望对你有一定的参考价值。

package {
       import flash.events.Event;
       
       import org.papervision3d.lights.PointLight3D;
       import org.papervision3d.materials.shadematerials.GouraudMaterial;
       import org.papervision3d.materials.utils.MaterialsList;
       import org.papervision3d.objects.parsers.Collada;
       import org.papervision3d.view.BasicView;
       
       public class ColladaParser_v1 extends BasicView {
        // create a class-level var for the collada scene
        private var _collada:Collada;
        // create the light
        private var _light:PointLight3D;
       
        public function ColladaParser_v1() {
         lights();
         init3d();
        }
       
        private function lights():void {
         // create the light to the scene
         _light = new PointLight3D(true, true);
         // place it in the same position as the camera (0, 0, -1000);
         _light.copyPosition(camera);
        }
       
        private function init3d():void {
         // create a materials list and add the wireframe material
         var knotMaterialsList:MaterialsList = new MaterialsList();
         // we are now going to use a gouraud material for shading
         var knotMaterial:GouraudMaterial = new GouraudMaterial(_light);
         knotMaterialsList.addMaterial(knotMaterial, "all");
         // instantiate the collada obj and load the knot object
         // apply the material and scale to 0.05
         _collada = new Collada("assets/knot.DAE", knotMaterialsList, 0.05);
         // add the collada file to the scene
         scene.addChild(_collada);
         // start rendering (activated onRenderTick)
         startRendering();
        }
       
        override protected function onRenderTick(event:Event = null):void {
         // rotate the object
         _collada.yaw(2);
         super.onRenderTick();
        }
       }
      }

以上是关于ActionScript 3 Papervision3D Collada Parser示例的主要内容,如果未能解决你的问题,请参考以下文章

ActionScript 3 ActionScript 3 SliceBitmap类

ActionScript 3 ActionScript 3中的XML循环

ActionScript 3 clickTag使用ActionScript 3

ActionScript 3 ActionScript 3中的反射

ActionScript 3 在ActionScript 3中嵌入字体

ActionScript 3 TextManager ActionScript 3.0类