# Trouble with local3DToGlobal()

**URL:** <https://forum.kirupa.com/t/trouble-with-local3dtoglobal/276309>\
**Category:** flash\
**Created:** [November 25, 2008, 6:20pm UTC](https://forum.kirupa.com/t/trouble-with-local3dtoglobal/276309 "2008-11-25T18:20:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertnyc](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@robertnyc](https://forum.kirupa.com/u/robertnyc)\
**Post date:** [November 25, 2008, 6:20pm UTC](https://forum.kirupa.com/t/trouble-with-local3dtoglobal/276309/1 "2008-11-25T18:20:33Z")

</div>

I’ve been having some trouble understanding displayObject.local3DToGlobal() –

I want to determine the global (stage) x/y coordinates of a display object that’s existing in Flash 3D space – i.e. has a Z. I thought what I’d do is this (in pseudocode):

```auto
class myDisplayObject {

v3:Vector3D = new Vector3D(this.x, this.y, this.z);
pt:Point = this.local3DToGlobal(v3);
}

```

but apparently what I need to do is

```auto
class myDisplayObject {

v3:Vector3D = new Vector3D(this.x, this.y, this.z);
pt:Point = [COLOR="Red"]parent[/COLOR].local3DToGlobal(v3);
}

```

That is, the local3DToGlobal call must be called by the parent of the object. Is this true? Why? What am I not grokking here? If I do it from the object itself, it gives me wrong coordinates…

and this is also true if I do it outside a class structure as in

```auto
v3 = new Vector3D(myDisplayObject.x,myDisplayObject.y,myDisplayObject.z);
pt = myDisplayObject.local3DToGlobal(v3);

```

as opposed to

```auto
v3 = new Vector3D(myDisplayObject.x,myDisplayObject.y,myDisplayObject.z);
pt = this.local3DToGlobal(v3;

```

)

Thanks for any info – I can’t find this documented anywhere in the Adobe docs/examples…
