[Papervision3D] Lines3D, LineMaterial, and the new system.
Noah Aronsson-Brown
noah at rdai.com
Fri Dec 14 15:06:12 PST 2007
Hello all,
I'm not the greatest coder but I have managed to do some things with Pv3D
and Andy Zupko's Line3D class in v1.5, however I am having so much trouble
getting anything to work in v2.0 and I really don't understand how the new
Line implementation works! If anyone could shed some light on this I would
really appreciate it!
Btw: To make things worse (or more complicated for myself anyway) I am now
working in Flex beta 3 instead of the Flash IDE!
Here is the source that is giving me no output:
public function init():void
{
//set up stage ---
stage.quality = StageQuality.LOW;
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
//set up viewport, add to stage
viewport = new Viewport3D(0,0,true);
viewport.opaqueBackground = 0;
addChild(viewport)
//set up renderer
renderer = new BasicRenderEngine();
//set up camera
camera = new Camera3D();
camera.z = -2000;
//set up light
//light = new PointLight3D(true);
//set up scene
myScene = new Scene3D();
//listen to enter frame
addEventListener(Event.ENTER_FRAME, onEnterFrame);
buildLine();
}
public function buildLine():void
{
//set up lines array
apoint = new Vertex3D(0,0,0);
bpoint = new Vertex3D(100,100,0);
nabContainer = new DisplayObject3D();
//create line material
nabLineMaterial = new LineMaterial(0xFFFFFF, 100);
//create line
nabLines = new Lines3D(nabLineMaterial)
nabLine = new Line3D(nabLines, nabLineMaterial, 8, apoint, bpoint);
//set up line container add line and add to scene
nabContainer.addChild(nabLines);
myScene.addChild(nabContainer);
//scene.addChild(lineContainer);
}
private function onEnterFrame(e:Event):void
{
//do something like rotate
//camera.lookAt(nabContainer);
nabContainer.yaw(2);
//render scene
renderer.renderScene(myScene, camera, viewport);
}
--
View this message in context: http://www.nabble.com/Lines3D%2C-LineMaterial%2C-and-the-new-system.-tp14339844p14339844.html
Sent from the Papervision3D mailing list archive at Nabble.com.
More information about the Papervision3D
mailing list