Well, I guess I am just having trouble getting it to work. It should
be working, but its not plotting the dots anywhere near the actual
click...basically u click the sphere earth, and it should put a dot
where u clicked...but its not going anywhere near there...i tried
playing with the formula a bit but to no avail..

Any ideas?

On Mar 23, 7:52 am, Ralph B <[email protected]> wrote:
> Hi, I'm not sure what your question is.  Your formulas look OK to me.
> Regarding the radius, the calculation for r returns the distance from
> the (x,y,z) point to the origin (0,0,0).  So if that does not match
> the radius of the earth, then the x,y,z point must not be on the
> surface of the earth.  (Of course, the earth is not quite exactly
> spherical anyway!)
>
> Ralph
>
> On Mar 22, 9:37 pm, dyc <[email protected]> wrote:
>
> > Hey there!
>
> > Thanks for the help, I got this along pretty far turning into an
> > actual function that works with my stuff...but im still not getting it
> > to work...it doesnt turn the actual coords into matching ones from the
> > MouseEvent3D.
>
> > Is there something wrong with the var r:Number part? Does that formula
> > return the radius from he center point? I know the radius and I am not
> > quite sure that it would match, but I dunno the actual match here...
>
> >                         var _x:Number = e.sceneX;
> >                         var _y:Number = e.sceneY;
> >                         var _z:Number = e.sceneZ;
>
> >                         var r:Number = Math.sqrt(_x*_x + _y*_y + _z*_z); // 
> > radius from
> > center of the earth to your point
> >                         var theta:Number = Math.acos(_z / r); // LAT in 
> > radians
> >                         var phi:Number = Math.atan2(_y, _x); // LON in 
> > radians
>
> >                         // Convert from radians above to degrees
> >                         var lat:Number = theta * 180 / Math.PI;
> >                         var lon:Number = phi * 180 / Math.PI;
>
> >                         trace("LON :: ", phi, "\nLAT :: ", theta);
>
> >                         addMarker(-lat, -lon);

To unsubscribe from this group, send email to 
away3d-dev+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to