Discussion:
Problem with texture Interaction
docie
2011-03-30 22:59:08 UTC
Permalink
Hello,

I have imported dae models and some textures on them. My work is on
FLARManager and i use PVP.
My problems are:

A) i can't interact with the indvidual textures. The mouse events refuse to
recognise the textures

this.scene3D = new Scene3D();
this.viewport3D = new Viewport3D(this.stage.stageWidth,
this.stage.stageHeight);
this.viewport3D.autoScaleToStage = true;
this.viewport3D.interactive = true;
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);

//MATERIAL IMPORTED
this.material = new
BitmapFileMaterial("../resources/assets/War_Elephant/images/texture1.jpg");
this.material.name = "text";
this.material.interactive = true;
this.materials = new MaterialsList();
this.materials.addMaterial(this.material,"all");

//IMPORT DAE and apply MaterialsList
this.model2 = new DAE();
this.model2.load("../resources/assets/Elephant/model.dae",this.materials,true);
this.model2.scale = 0.05;
this.model2.rotationX = 90;

//This is the container for the model2
this.modelContainer2 = new DisplayObject3D();
this.modelContainer2.addChild(this.model2);
this.modelContainer2.visible = false;
this.scene3D.addChild(this.modelContainer2);

//Here are the EventListeners i use to interact with the texture
this.????.addEventListener(MouseEvent.MOUSE_OVER, handleObjectOver);
this.????.addEventListener(MouseEvent.CLICK, handleObjectClick);

//Finally the functions to test

private function handleObjectOver(evt:MouseEvent):void
{
this.viewport3D.containerSprite.buttonMode = true;
}

private function handleObjectClick(evt:MouseEvent):void
{

this.viewport3D.containerSprite.buttonMode = true;
this.model2.x += 5;
}

I need your help because i do not understant what to put beside of the ????
to the EventListeners
The material2 doesn't work and the DAE textures are more complicated than a
simple plane or cube.

B) The second problem is that this model has many texture for different
parts. How can i include them all?

Thanks in advance

--
View this message in context: http://papervision3d.758870.n4.nabble.com/Problem-with-texture-Interaction-tp3419679p3419679.html
Sent from the Papervision3D mailing list archive at Nabble.com.

Loading...