View Full Version : shape files
03-30-2009, 12:19 AM
I am working on displaying .shp(shape) files in OpenGL so if you all can just help me out in knowing how to display thm
03-30-2009, 04:10 AM
Do you mean this (http://en.wikipedia.org/wiki/Shapefile) file format ?
At a first glance it seems to be fairly simple. A .shp file may contain points, lines or polygons.
Points and lines can be directly fed to opengl. Polygons need to be tessellated into triangles first.
03-31-2009, 11:07 PM
thanks a lot for your reply
if you have some sample code related to this then just give me a link to it.
04-01-2009, 02:03 AM
Nope, I haven't used this format myself yet.
I don't know what your experience level with opengl or programming in general is, but if you got stuck on any specific problem, feel free to ask !
04-01-2009, 03:49 AM
i have not gone in depth into OpenGL.
i m just working on how to display .shp files in OpenGL on linu platform
i have got many libraries to use in windows but nothing useful in linux so far.
04-01-2009, 07:31 AM
Are you kidding ?
First result for "shapefile lib" http://shapelib.maptools.org/
04-07-2009, 10:45 PM
i have gone through the details of shape files.
Just wanna know a method to use them in my OpenGL application.
If you have a sample code or any useful link on how to use thm thn kindly send it to me
04-08-2009, 05:30 AM
(1) Read the primitives (points/lines/polygons) from the shapefile,
(2) tessellate polygons into triangles (you might want to take a look at GLU), and
(3) send them to opengl for rasterization.
You might want to use the bounding box provided in the shapefile header to set up your projection matrix, so the geometry will actually fit in your window.
If this doesn't (fully) answer your question, maybe you should ask more detailed ;)
04-09-2009, 10:48 PM
thanks a lot for your reply.
i am not able to open .shp file for rading the primitives.
so can u kindly suggest me how to do it
04-29-2010, 09:55 AM
I have explained this in this article ...
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.