| | |
PLotting a map/graph
![]() |
•
•
Join Date: Jul 2005
Posts: 7
Reputation:
Solved Threads: 0
Hi, hmm hav a query right here about how do i go about plotting a map/graph using c programming.
i hav the x and y cordinates which are the variables, but do not know how to go about starting/writing the program.
i heard one of the ways is to import the data using microsoft Excel
Would be grateful if anyone could guide me through this problem..
Thanks,
ben
i hav the x and y cordinates which are the variables, but do not know how to go about starting/writing the program.
i heard one of the ways is to import the data using microsoft Excel
Would be grateful if anyone could guide me through this problem..
Thanks,
ben
•
•
Join Date: Jul 2005
Posts: 1,678
Reputation:
Solved Threads: 263
The C and C++ languages do not have native graphical capabilities. To do things other than bar graphs oriented either horizonally or vertically with the bar made up of a series of characters, (that is histogram), you need to use a third party library such as Windows API or even more sophisticated OpenGL or DirectX.
Example of horizontal histogram to indicate results of poll indicated 60% for option A and 40% for option B using the asterix char:
A ******
B ****
and vertically
*
*
* *
* *
* *
* *
A B
Example of horizontal histogram to indicate results of poll indicated 60% for option A and 40% for option B using the asterix char:
A ******
B ****
and vertically
*
*
* *
* *
* *
* *
A B
If you are working in the linux environment I reccomend using an API such as Qt (for KDE) and gtk+ (for GNOME).
These APIs will allow you to easily have access to opengl functionality (you can read their docs).
For example, with Qt, you would create a main window and overlay the window with a QCanvas widget. On the QCanvas, you can use a paint method to draw pixels at specific locations.
Definetly check out the appropriate api for your linux desktop environment (I'm assuming you are using either KDE or GNOME) -- it makes using OpenGL alot easier.
Let me know how it goes.
These APIs will allow you to easily have access to opengl functionality (you can read their docs).
For example, with Qt, you would create a main window and overlay the window with a QCanvas widget. On the QCanvas, you can use a paint method to draw pixels at specific locations.
Definetly check out the appropriate api for your linux desktop environment (I'm assuming you are using either KDE or GNOME) -- it makes using OpenGL alot easier.
Let me know how it goes.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
![]() |
Other Threads in the Game Development Forum
- Previous Thread: Linux Sound??
- Next Thread: Rookie in game development. Where should I start?
| Thread Tools | Search this Thread |
3d advertising ai algorithm ban c++ cambridge camera censorship china competition console development engine fov fpx game gamer games gaming gauntanamo government idaho in-gameadvertisement intellectualproperty l-systems laracroft lindenmayer live manhunt math mathematics matrix mercenaries microsoft mmorpg modded msn naked news nintendo obama opengl palin physics pirate playstation politics projection ps3 rpg search selection software sony stephenhawking stocks studio technology terrorism tombraider uk videogame web wii world-of-warcraft xbox xbox-live xbox360






