myScreenVertex = myView.myCamera.screen(myObject3d) that should give you what you want!
Rob On Fri, Feb 13, 2009 at 8:56 AM, timdiacon <[email protected]> wrote: > > Rob, > > Thanks. It's not locating an object or accessing the parent that is > the problem, it's getting the 2D co-ordinates (along with the width > and height) that I am after. If I access the parent and trace out the > x and y co-ordinates you just get 0,0. > > What I am trying to achieve is to position a 2D square over the top of > an object in the 3D scene. The 3D object resides in a standard flash > sprite which I refer to as the "container" as this is what they call > it in other 3D engines. There does not however seem to be anyway of > accessing this object from the 3D object (it is not simply the > parent). > > I've found a ton of posts about people trying to do this but as yet no > solution. It seems such a simple and obvious thing to need to do? > > Tim > > On Feb 13, 2:30 am, Rob Bateman <[email protected]> wrote: > > to access the parent of any object, simply use: > > > > myObject3D.parent > > > > generally speaking, it is good practice to keep object a scene hierarchy > > with names, so that they are easy to access. A named object can be > returned > > simply by doing: > > > > scene.getChildByName("myobjectName"); > > > > this will locate the object with the given name no matter where it is in > the > > scene hierarchy > > > > Rob > > > > > > > > On Thu, Feb 12, 2009 at 6:03 PM, timdiacon <[email protected]> > wrote: > > > > > Hi, > > > > > I need to get the position and size of a 3D object so that I can > > > overlay some text on it. I have found the following method in the > > > away3D examples: > > > > >http://away3d.com/examples.php?example=203&_searchterm=; > > > > > However the problem I have is that my scene contains many items, and > > > as I have no way of getting the name or depth of the 3dObject I cannot > > > access it. > > > > > Surely there must be some way of accessing the parent container of any > > > 3dObject. I know in Sandy you can simply call myObject.container. > > > > > Any ideas? > > > > -- > > Rob Bateman > > Flash Development & Consultancy > > > > [email protected] -- Rob Bateman Flash Development & Consultancy [email protected] www.infiniteturtles.co.uk www.away3d.com
