纳金网

标题: [PV3D专题]PV3D的ReflectionView [打印本页]

作者: .    时间: 2013-3-21 15:56
标题: [PV3D专题]PV3D的ReflectionView
PV3D的BasicView已经很熟悉了,这个ReflectionView是继承自BasicView的。基本功能和用法与BasicView无异,只是增加了反射。
源码参考如下:
package {
import flash.display.Bitmap;
import flash.events.Event;
import flash.filters.GlowFilter;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;import org.papervision3d.core.effects.view.ReflectionView;
import org.papervision3d.materials.BitmapMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.primitives.Cube;[SWF(width = "320",height = "240",frameRate = "30",backgroundColor = "0xeeeeee")]
public class PV3D_t005 extends ReflectionView
{
   private var cube:Cube;
   [Embed(source = "frame.jpg")]
   public var frame:Class;
   public function PV3D_t005()
   {
    super(320,240,false,false);
    init();
    addLink()
    surfaceHeight = -250;
    camera.z = 1000;
    this.addEventListener(Event.ENTER_FRAME,enterFrame);
   }
   private function init():void{
    var bm:Bitmap = new frame() as Bitmap;
    var materials:MaterialsList = new MaterialsList();
    materials.addMaterial(new BitmapMaterial(bm.bitmapData,***e),"all");
    cube = new Cube(materials,200,200,200,1,1,1);
    scene.addChild(cube);
   }
   private function enterFrame(e:Event):void{
    cube.yaw(3);
    singleRender();
   }
   private function addLink():void{
    //add link
   }
}
} 【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/
作者: libufan    时间: 2013-3-22 00:40
谢谢楼主分享,学习了

作者: 89684598    时间: 2014-2-22 15:32
好东西啊,感谢分享




欢迎光临 纳金网 (http://rs.narkii.com/club/) Powered by Discuz! X2.5