Advertisement

05.08.2008 at 04:56AM PDT, ID: 23385708 | Points: 500
[x]
Attachment Details
opengl coordinate system
I have some 2D maps in UTM coordinates( I got from Google earth)...How to convert the UTM coordinates into local opengl coordinates  to display the map in my graphics window?

thank you...
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: jsbsudha
Question Asked On: 05.08.2008
Participating Experts: 2
Points: 500
Views: 0
Translate:
Loading Advertisement...
05.08.2008 at 05:00AM PDT, ID: 21523910

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 06:20AM PDT, ID: 21524344

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 06:20AM PDT, ID: 21524347

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 06:35AM PDT, ID: 21524492

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 06:37AM PDT, ID: 21524524

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.08.2008 at 09:46AM PDT, ID: 21526355

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 04:57AM PDT, ID: 21531863

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 05:54AM PDT, ID: 21532252

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 09:01AM PDT, ID: 21534203

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.08.2008 at 05:00AM PDT, ID: 21523910

Rank: Genius

Depends what kind of coordinates you are using in your application.
 
05.08.2008 at 06:20AM PDT, ID: 21524344
for example UTM coordinates  for x and y  for the  2d map is
X = 555737( upper left corner)
y = 555794( lower right corner)

I just want to convert this into local opengl coordinates and sdisplay the map in my graphics window....
1, Is it possible to convert...?
2, my current opengl window  has defined the viewing voulme
glortho(-24,24,-24,24,0.1,1000)...... In that case is there any idea to visualize this map......



 
05.08.2008 at 06:20AM PDT, ID: 21524347
Botgh UTM coordinates and opengl coordinates are cartesian coordinates
 
05.08.2008 at 06:35AM PDT, ID: 21524492

Rank: Genius

>> X = 555737( upper left corner)
>> y = 555794( lower right corner)

upper left and lower right corner ? Aren't they the x and y coordinates of one and the same point ? Which UTM zone ?


>> I just want to convert this into local opengl coordinates and sdisplay the map in my graphics window....

I assume that you have the full UTM coordinates of the top left and bottom right ?
You also have the coordinates of the top left and bottom right of the window in your OpenGL application. You just have to map the UTM coordinates on the OpenGL coordinates ...
 
05.08.2008 at 06:37AM PDT, ID: 21524524
First, you should convert UTM to Latitude/Longitude. It is not a simple function, as UTM take on count a number of variables, including the most precise as possible exact Earth geometry (the planet isn't a sphere...). There are several Dati for these variables.

For example, the general acceptance of planet's equatorial radius E = 6,378,137 m, polar P = 6,356,752.3142 and Flattening F=(E-P)/E =1/298.257223563.

Actually there are several Dati for each Earth region, useful when we need very precise conversion. I have a personal experience of a wrong Datum causing more than 100m errors. Depending on the application, such error can be acceptable or not.

A tutorial and conversion UTM --> Lat/Long are very well described by Prof. Steven Dutch, of University of Wisconsin, at
http://www.uwgb.edu/dutchs/UsefulData/UTMFormulas.htm
including a spreadsheet to do the conversion.

As soon you have Latitude and Longitude, the next step is to convert them to a cartographic projection. There are several ones to chose from, but most common is Mercator.

If the images you gain from Google Earth are very small related to planet size (say, a city, a street, a farm, a lake) then you can use them directly, as cartographic images (the distortion or error are smaller than a single pixel!).

At this point a question, why OpenGL?
If you are merging such images with a game or other OpenGL program, it makes sense thinking in a OpenGL window. If not, the images can be shown in a single Windows Form, by calling GDI or C++/CLR functions.

Anyway, it is important to store not only the images, but their UTM extents (or already converted Lat/Long) as well.

When rendered in a window, you can use a scale to show Lat/Long, which can be easely converted to X,Y coordinates.
In the simple sample code below, FX is a scale factor. If you make a 360 x 180 pixels window to show the entire planet, then FX is set to 1.
If the same window shows an image 30 degrees wide, for example x1= 106° and x2 = 136° then FX = 360/(136-106) = 12.

Jose
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
Simple algorithm to convert Latitude and Longitude to 2D Windows coordinates
 
INPUT: 
Lat = 	Latitude value in degrees, 
	positve to North, negative to South
 
Lon = 	Longitude value in degrees,
	positive to East, negative to West
 
FX =	factor to scale x
FY =	factor to scale y. Default is FY=FX
 
function convert_LatLon_2D(Lat, Lon, FX, FY)
{
	tmpLat = Lat + 90
	tmpLon = lon + 180
	x = tmpLon * FX
	y = tmpLat * FY
	return x,y
}
Open in New Window
 
05.08.2008 at 09:46AM PDT, ID: 21526355
Jose parrot
Thak you very much for your reply.....I will try to work on it and come to you again....
 
05.09.2008 at 04:57AM PDT, ID: 21531863
jose parrot:
Can you explain me whay UTM coordinates should be converted into Latitude and longitude...
 
05.09.2008 at 05:54AM PDT, ID: 21532252

Rank: Genius

I would simply map them :) Map the top left UTM coordinates onto the top left of your OpenGL window, and the bottom right UTM coordinates onto the bottom right of your OpenGL window.

All other points are interpolated.
 
05.09.2008 at 09:01AM PDT, ID: 21534203
jsbsudha:
UTM includes world very precise format, which isn't an exact sphere. Actually the Earth shape is calle geoyd, simplified to ellipsoids for each region. To render in a precise grid, as the pixels grid, the intermediate conversion to Lat/Long corrects the imprecisions in the plane projections. Then to convert to x,y is as simple as the sample code.

If such imprecision isn't relevant to your purposes, if you don't need neither to know the scale, nor the position nor correct distances, then you can work with UTM directly.

In this case you will simply watch images, which will be at unknown scale.
Also, if you don't need maintain the aspect ratio (proportion) then you can simply map the image as suggested by Infinity08, which is, by far, the simplest approach to the question.

Jose
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628