Please support our Game Development advertiser: Programming Forums
![]() |
•
•
Join Date: Jul 2005
Posts: 7
Reputation:
Rep Power: 0
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,395
Reputation:
Rep Power: 10
Solved Threads: 196
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?
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode