- 最后登录
- 2018-12-19
- 注册时间
- 2012-8-20
- 阅读权限
- 90
- 积分
- 54706
- 纳金币
- 32328
- 精华
- 41
|
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/ |
|