I've been working for a couple days now on creating a component that creates a collection of objects around a DisplayObject3D in Papervision3D. I've got the component working and it's pretty cool but i can't seem to get the individual objects to be selectable.
I've tried to add an InteractiveScene3DEvent to each of my objects, I have my viewpoit.interactive = true, and each material for my objects item.material.interactive = true but Im still not getting the InteractiveScene3DEvent to fire.
Here is a portion of my code:
Code:...
viewport.interactive = true;
...
var pivot:DisplayObject3D = new DisplayObject3D();
...
for each(var item:Text3D in wordColl)
{
var theta:Number = Math.random()*360;
var phi:Number = (1-2*Math.random())*radius;
item.x = Math.sqrt(radius*radius-phi*phi)*Math.cos(theta*Math.PI/180);
item.y = Math.sqrt(radius*radius-phi*phi)*Math.sin(theta*Math.PI/180);
item.z = phi;
item.scale = .75;
item.material.interactive = true;
pivot.addChild(item);
}
makeChildrenInteractive(pivot);
...
private function makeChildrenInteractive(object:DisplayObject3D):void
{
for each(var item:Text3D in object.children)
{
item.addEventListener(InteractiveScene3DEvent.OBJECT_OVER, onItemOver);
item.addEventListener(InteractiveScene3DEvent.OBJECT_CLICK, onItemClick);
}
}
If anyone has experience using pivots in papervision 3D (Great White) and can help, I would be greatly appreciative.