RSS Forums RSS
Please support our Game Development advertiser: Programming Forums
Views: 4809 | Replies: 9 | Thread Tools  Display Modes
Reply
Join Date: Jul 2005
Posts: 7
Reputation: crazyfans86 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
crazyfans86 crazyfans86 is offline Offline
Newbie Poster

PLotting a map/graph

  #1  
Aug 6th, 2005
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2005
Posts: 7
Reputation: crazyfans86 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
crazyfans86 crazyfans86 is offline Offline
Newbie Poster

Help Re: PLotting a map/graph

  #2  
Aug 7th, 2005
anyone knows ?
Reply With Quote  
Join Date: Jul 2005
Location: London
Posts: 164
Reputation: Stoned_coder is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 5
Stoned_coder Stoned_coder is offline Offline
Junior Poster

Re: PLotting a map/graph

  #3  
Aug 7th, 2005
Plotting a graph will almost certainly need to use the services of the operating system to be accomplished. In a console you can plot a simple ascii histogram but not much more. What OS are you using?
Reply With Quote  
Join Date: Jul 2005
Posts: 7
Reputation: crazyfans86 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
crazyfans86 crazyfans86 is offline Offline
Newbie Poster

Help Re: PLotting a map/graph

  #4  
Aug 7th, 2005
i'm using Miicrosoft Xp Windows.

About what u said earlier about the simple ascii histogram .. Could u maybe explain what is it about.. Nv heard of it b4..
Reply With Quote  
Join Date: Jul 2005
Location: London
Posts: 164
Reputation: Stoned_coder is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 5
Stoned_coder Stoned_coder is offline Offline
Junior Poster

Re: PLotting a map/graph

  #5  
Aug 7th, 2005
Its trivial to plot asterixes for instance in the console but if you want curves or anything more graphical you will need to use a window. How much do you know about making a window and painting it in C?
Reply With Quote  
Join Date: Jul 2005
Posts: 7
Reputation: crazyfans86 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
crazyfans86 crazyfans86 is offline Offline
Newbie Poster

Re: PLotting a map/graph

  #6  
Aug 7th, 2005
Just started reading up some c programming books not long ago.. Perhaps u could give me an example of how to plot just 1 cordinate or something.. because i'm not quite sure about this array thingy.

would appreciate it
Reply With Quote  
Join Date: Jul 2005
Posts: 1,395
Reputation: Lerner is just really nice Lerner is just really nice Lerner is just really nice Lerner is just really nice Lerner is just really nice 
Rep Power: 10
Solved Threads: 196
Lerner Lerner is offline Offline
Nearly a Posting Virtuoso

Re: PLotting a map/graph

  #7  
Aug 7th, 2005
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
Reply With Quote  
Join Date: Jul 2005
Posts: 7
Reputation: crazyfans86 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
crazyfans86 crazyfans86 is offline Offline
Newbie Poster

Re: PLotting a map/graph

  #8  
Aug 8th, 2005
Sorry, but my working environment would be using the LINUX operating system, so i guess the library file which i include would be differenet ?

Perhaps u could show me an example of the program ?
Reply With Quote  
Join Date: Jul 2005
Location: London
Posts: 164
Reputation: Stoned_coder is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 5
Stoned_coder Stoned_coder is offline Offline
Junior Poster

Re: PLotting a map/graph

  #9  
Aug 8th, 2005
perhaps you should have a go yourself. To do a histogram in ASCII all you need is iostream. You will not get much help by showing no effort and demanding code.
Reply With Quote  
Join Date: Mar 2004
Posts: 218
Reputation: BountyX is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 6
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Re: PLotting a map/graph

  #10  
Aug 8th, 2005
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.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Other Threads in the Game Development Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 8:44 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC