Papervision3D: understanding Plane object
2009-10-20 00:00:00 来源:WEB开发网Let’s look at the movie:
If you notice, when the plane rotates over 180 degrees, it disappears. By default, planes aren’t double sided.
To create a double sided plane, we’ll need to define a material and set this material as double sided.
package {
import flash.display.Sprite;
import flash.events.Event;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.render.BasicRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.materials.WireframeMaterial;
public class papervision extends Sprite {
public var viewport:Viewport3D = new Viewport3D();
public var scene:Scene3D = new Scene3D();
public var camera:Camera3D = new Camera3D();
public var renderer:BasicRenderEngine = new BasicRenderEngine();
public var wireframe:WireframeMaterial = new WireframeMaterial();
public var plane:Plane= new Plane(wireframe);
public function papervision() {
addChild(viewport);
wireframe.doubleSided = true;
scene.addChild(plane);
addEventListener(Event.ENTER_FRAME, render);
}
public function render(e:Event) {
plane.pitch(1);
renderer.renderScene(scene, camera, viewport);
}
}
}
Tags:PapervisionD understanding Plane
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接