Well, I dont know if Away has any native tools for this kind of stuff, but
if there isn't, what comes to my head is this:

You can obtain a vector from the object to the cube by comparing the 2
objects' positions. Once this is done you can run line-plane intersection
tests with each of the cubes faces obtaining a series of 3d numbers. Once
you have these numbers you can analyze which one is nearest (I imagine you
would have to compare 2 of the results, the rest would be null)... and there
you go, you have a point in 3d space representing a point on the cube's
surface between the line joining the objects.

The only complex part is solving the mathematical problem of finding the
intersection between a line and a plane, which you can google easily. Its a
very common problem in maths.

Hope it helps,
Cheers!

On Mon, Dec 8, 2008 at 12:26 PM, cellis <[EMAIL PROTECTED]>wrote:

>
> From an object in the same scene. I know i can say obj.distanceTo
> (cube). As for the position on the face, the nearest point is what i
> am looking for.
>
> On Dec 8, 12:12 am, Li <[EMAIL PROTECTED]> wrote:
> > Hey Cellis,
> >
> > Maybe if you define your question a bit more I can help you.
> >
> > From where?
> > To where? Any point in the face, nearest?
> >
> > On Sun, Dec 7, 2008 at 11:15 PM, cellis <[EMAIL PROTECTED]
> >wrote:
> >
> >
> >
> > > Hello all,
> >
> > > how could i find the distance to , for instance, the back xy face of a
> > > cube?
>

Reply via email to