Discussion:
Adding another object with FLARManager
IaRRoVaWo
2011-01-26 20:06:10 UTC
Permalink
Hi there!

I have to do a project with FLARToolKit and Papervision (using FLARManager)
but I'm new in AS3 and Papervision.

I have a problem, well, I think it's a damn problem but I'm getting crazy! I
can't solve it.

I follow the Loading Collada Models tutorial [1] from FLARManager webpage
and I want to put a plane in the scene but it seems that it never appears.

This is my code (first of all I initialize FLARManager and then I initialize
Papervision):

private function initPV3D(evt:Event):void {
this.flarManager.removeEventListener(Event.INIT, this.initPV3D);

this.scene3D = new Scene3D();
this.viewport3D = new Viewport3D(this.stage.stageWidth,
this.stage.stageHeight);
this.addChild(this.viewport3D);
this.camera3D = new FLARCamera_PV3D(this.flarManager, new
Rectangle(0, 0, this.stage.stageWidth, this.stage.stageHeight));
this.renderEngine = new LazyRenderEngine(this.scene3D,
this.camera3D, this.viewport3D);

this.pointLight3D = new PointLight3D();
this.pointLight3D.x = 1000;
this.pointLight3D.y = 1000;
this.pointLight3D.z = -1000;

// load Collada model
var objeto3D:DAE = loaderDAE(SCOUT);

// create a container for the model, that will accept matrix
transformations.
this.modelContainer = new DisplayObject3D();
this.modelContainer.addChild(objeto3D);
this.modelContainer.visible = false;
this.scene3D.addChild(this.modelContainer);

* // create a plane
var material:ColorMaterial = new ColorMaterial(0x000000,0.5);
var plano:Plane = new Plane(material,100,100,5,5);
this.modelContainer2 = new DisplayObject3D();
this.modelContainer2.addChild(plano);
this.modelContainer2.visible = true;
this.scene3D.addChild(this.modelContainer2);*

this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}

When I run the SWF file the plane doesn't appear. What Am I doing bad? Can
anyone help me? Any clue?

Thanks in adv!

[1]:
http://words.transmote.com/wp/flarmanager/inside-flarmanager/loading-collada-models/
Makc
2011-01-26 20:42:06 UTC
Permalink
by default your plane is added at 0,0,0 i.e. exactly where camera is,
so it is culled. you need to move it to some non-zero z, I think.
IaRRoVaWo
2011-01-26 23:39:17 UTC
Permalink
Oh yes! A lot of thanks!
Post by Makc
by default your plane is added at 0,0,0 i.e. exactly where camera is,
so it is culled. you need to move it to some non-zero z, I think.
_______________________________________________
Papervision3D mailing list
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
Loading...