- 最后登录
- 2018-12-19
- 注册时间
- 2012-8-20
- 阅读权限
- 90
- 积分
- 54706
- 纳金币
- 32328
- 精华
- 41
|
首先来看一下BasicView的帮助说明
BasicView provides a simple template for quickly setting up basic Papervision3D projects by creating a viewport, scene, camera, and renderer for you. Because BasicView is a subclass of Sprite, it can be added to any DisplayObject.
意思就是更方便的使用ViewPort ,Scene,camera,以及renderer用BasicView来提供简洁的模版,BasicView是
继承自Spirte的,因此他可以被添加到显示对象中.(翻译的灰常垃圾,凑货看把)
因此我们可以写一个extends BasicView的类来快速的创建我们的3D模版而不在象上一次说的又new
ViewPort,又new Scene等等一系列环境。我们的基本代码如下
package
{
import flash.display.Sprite;import flash.display.StageAlign;
import flash.display.StageScaleMode;
import org.papervision3d.core.geom.Lines3D;
import org.papervision3d.core.geom.renderables.Line3D;
import org.papervision3d.core.geom.renderables.Vertex3D;
import org.papervision3d.core.proto.MaterialObject3D;
import org.papervision3d.materials.WireframeMaterial;
import org.papervision3d.materials.special.LineMaterial;
import org.papervision3d.objects.primitives.Sphere;
import org.papervision3d.view.BasicView;/**
* ...
* @author SpadeA
*/
public class Lesson02 extends BasicView
{
private var sphere:Sphere;
public function Lesson02()
{
super(640, 480, ***e, false);
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
initSphere();
startRendering();
}
private function initSphere() {
sphere = new Sphere(null, 50, 10, 10);
scene.addChild(sphere);
}
}} 【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/ |
|