BasicView

package {
import flash.events.Event;
import org.papervision3d.objects.primitives.Sphere;
import org.papervision3d.view.BasicView;
public class BasicViewExample extends BasicView {
  private var sphere:Sphere;
  public function BasicViewExample() {
   /* super.BasicView(width=640,height=480,scaleToStage(是否让viewPort3D视窗为舞台大小)); 当想改变大小时可以用它

   stage.frameRate=40;
   //下面只需定义3D对象, 在将其add到scene中
   sphere = new Sphere();
   scene.addChild(sphere);
   startRendering();//创建secne3D basicRenderEngine  viewPort3D camera3D  
  }
  // 重写 onRenderTick 及其 调用父类onRenderTick ;
  override protected function onRenderTick(e:Event=null):void {
   sphere.localRotationY+=1;//旋转轴
   super.onRenderTick();//开始渲染
  }
}
}

posted @ 2010-06-30 14:43  LT世纪  阅读(162)  评论(0编辑  收藏  举报