Home Tutorials Forums Articles Blogs Movies Library Employment Press

 ActionScript.org Forums Converting Latitude and Longitude to X, Y, Z
 Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

 03-22-2008, 03:08 AM #3 lordofduct Senior Member     Join Date: Feb 2008 Location: West Palm Beach, FL Posts: 3,883 excuse the amount of times I edited this. I wanted to the most important info to you early, but still explain it. I'm busy with other stuff as well though, so it took a little while. __________________ www.lordofduct.com - come read my blog! If you want to know how to program, take a math class, take a lot of math classes!
 03-25-2008, 11:49 PM #4 miquael New Member     Join Date: Apr 2004 Posts: 24 This helps alot, yet I am still not understanding all of this ... especially in the context I am working with. I have made a step closer to success by converting the latitude and longitude to radians with this: latitude = Math.PI * latitude / 180; longitude = Math.PI * longitude / 180; Now at least the nodes appear to be in an appropriate relative position to each other. For example, Portland, San Francisco, and New York City all seem about the right relative positions to each other. Yet they are all plotting over the ocean just east of South America--so the relative positioning is still off. I will see what I can do with the rest of this information (having a hard time wrapping my head around these types of conversions). Concrete examples help me understand the most. Which type of cartesian space is natural to Flash? From my experience, I believe that Flash operates with 0 degrees (x) on the right side of any circle (which in this case would also influence z). This is not "standard" orientation I believe, so some type of conversion is probably necessary.
 03-25-2008, 11:51 PM #5 miquael New Member     Join Date: Apr 2004 Posts: 24 Again, all the source code can be found here: http://code.google.com/p/meadanglobe
 03-26-2008, 12:08 AM #6 miquael New Member     Join Date: Apr 2004 Posts: 24 As you described above, I attempted: y = ro * cos(phi) * sin(theta) by this in ActionScript: yPos = (app.radius) * Math.cos(longitude) * Math.sin(latitude); (where before I had: yPos = (app.radius) * Math.sin(longitude) * Math.cos(latitude)) But this produced even worse results. (?)
 03-26-2008, 12:19 AM #7 miquael New Member     Join Date: Apr 2004 Posts: 24 In this case, Z is not up, it is forward. And I believe that 0 X is on the right. Is this then "Right handed Z forward"?
 03-26-2008, 02:15 AM #8 miquael New Member     Join Date: Apr 2004 Posts: 24 Since 0,0 is plotting in the middle of the Pacific (when it should be just off the coast of the Congo), it must be off by about 180.
 03-26-2008, 02:27 AM #9 miquael New Member     Join Date: Apr 2004 Posts: 24 FYI, for any geo experts, there is this related post on how to plot curve lines over a sphere: http://www.actionscript.org/forums/s...961#post722961
 03-28-2008, 02:15 AM #10 miquael New Member     Join Date: Apr 2004 Posts: 24 okay, i solved it with this: // convert lat/long to radians latitude = Math.PI * latitude / 180; longitude = Math.PI * longitude / 180; // adjust position by radians latitude -= 1.570795765134; // subtract 90 degrees (in radians) // and switch z and y (since z is forward) xPos = (app.radius) * Math.sin(latitude) * Math.cos(longitude); zPos = (app.radius) * Math.sin(latitude) * Math.sin(longitude); yPos = (app.radius) * Math.cos(latitude);

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home ActionScript Forums Group     ActionScript 3.0     ActionScript 2.0     ActionScript 1.0 (and below)     Simple Stuff (Newbies) Flash General Questions     Flash 10 General Questions     Flash 9 General Questions     Flash 8 General Questions     Other Flash General Questions Flex     Flex 2, 3 & 4     Flex 1 Extensions and Plugins     Components     JSFL - Extending Flash Desktop, Mobile and non-browser Environments     AIR (Apollo)     FlashLite / Portable Devices Development     Projectors and CDs Supporting Technologies     HTML and JavaScript     haXe     Server-Side Scripting     Flash Remoting     Flash Media Server General     Best Practices     Gaming and Game Development     Animation and Effects     Flashants Support Forum Community Boards     General Chat     Just for Kicks Challenges     Detention Flash In Action     Site Check     Cool Sites     Widgets Decommissioned     Projects and Positions CMS Forums     Announcements Board     Content Postings / Updates     Product Review Requests     CMS Technical Questions     Process Questions     Collaboration & Suggested Articles

 Similar Threads Thread Thread Starter Forum Replies Last Post LiQuidShade ActionScript 2.0 0 02-14-2008 01:33 PM D-flyer ActionScript 2.0 4 10-29-2006 09:20 PM @bc ActionScript 1.0 (and below) 4 05-20-2006 12:39 AM sdw135 ActionScript 1.0 (and below) 2 05-23-2004 04:41 PM image ActionScript 1.0 (and below) 5 01-09-2003 07:33 PM

All times are GMT. The time now is 06:12 PM.

///