Triad Flex User Group Logo
Welcome Guest Search | Active Topics | Members | Log In | Register

Pivot point DisplayObject3D: making items clickable Options
shawny
Posted: Monday, November 10, 2008 6:00:04 PM
Rank: Administration
Groups: Administration

Joined: 8/8/2008
Posts: 39
Points: 32
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.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Powered by Yet Another Forum.net version 1.9.1.7 (NET v2.0) - 11/20/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 1.258 seconds.