Results 1 to 5 of 5

Thread: new to open GL - drawing 2d chart with GLUT and C

  1. #1
    Junior Member Newbie
    Join Date
    May 2009
    Posts
    2

    new to open GL - drawing 2d chart with GLUT and C

    Hi there,

    I am relatively new to openGL and would like some help getting started with what i am trying to do.

    Basically in the language C i wish to create a very simple bar chart with the GLUT library functions. The chart will ned to be drawn from a variable who's values are seperated by commas.

    e.g. the variable might be something like this:

    graph = "10,20"

    I'd need the Y axis to go up to the highest number and the x axis to cater for the amount of elements within the variable which are split up by commas.

    Does anybody have a simple example of how to create a 2d graph in C using GLUT?

    I know that there's many tutorials out there for drawing in openGL but one specifically for drawing graphs would be good.

    If anybody can make a simple tutorial up or perhaps post a possible solution to what i have asked then that would be great. But as i say, i have a variable and i wish it's values separated by commas to be displayed in a graph. Each element from the split will be a bar in the graph and the labels for axis don't matter too much.

    Again, just to mention, this is for C and not C++. Any good recommendations are apprechiated

    Thanks

  2. #2
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    374

    Re: new to open GL - drawing 2d chart with GLUT and C

    Quote Originally Posted by Sharkadder
    Any good recommendations are apprechiated
    Option 1:
    Learn to do it without OpenGL and come back if you have any OpenGL related problems. A general C forum sounds like a good place to start.

    Option 2:
    Send me money and I will do it for you. But a C program will be more expensive than C++.

    Option 3:
    Wait and pray that another forum user is stu... I mean nice enough to do your work for you.

    Option 4:
    Tell us what you have achieved and what your current problem is. If it is OpenGL related you will get an answer, if not back to Option 1, 2 or 3.

    Free gift: http://www.catb.org/~esr/faqs/smart-questions.html

    happy coding

  3. #3
    Junior Member Newbie
    Join Date
    May 2009
    Posts
    2

    Re: new to open GL - drawing 2d chart with GLUT and C

    Hi there,

    Well i do feel that you're being a bit harsh there considering this is a part of the forum for "beginners", we all have to start somewhere.

    I have looked around the net for chart examples but a lot of them just lead to drawing shapes. Rather than working out what should be drawn etc. i was after an example using the glut library functions that draw a graph which i could work through instead of doing it all manually and figuring it out by drawing shapes, obviously i'll have to keep looking or alternatively start by drawing shapes and making one by figuring out how to bodge shapes/lines together manually.

    Anyways thanks for the input

  4. #4
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    374

    Re: new to open GL - drawing 2d chart with GLUT and C

    Quote Originally Posted by Sharkadder
    Well i do feel that you're being a bit harsh there
    I don't think so.

    Quote Originally Posted by Sharkadder
    considering this is a part of the forum for "beginners"
    Yes, for OpenGL beginners.

    Quote Originally Posted by Sharkadder
    we all have to start somewhere.
    For you a good place to start would be the link I gave you. Much to read but it will help you enormously in the long run. You will learn why your first post was not smart at all. And reading this will tell you why your second post was not very clever either.

    Quote Originally Posted by Sharkadder
    I have looked around the net for chart examples but a lot of them just lead to drawing shapes. Rather than working out what should be drawn etc. i was after an example using the glut library functions that draw a graph which i could work through instead of doing it all manually and figuring it out by drawing shapes
    I don't comment on this to not embarrass you even more.

    Quote Originally Posted by Sharkadder
    or alternatively start by drawing shapes and making one by figuring out how to bodge shapes/lines together manually.
    Sounds good to me. If you have any problems with the drawing search the web for the mysterious NeHe and you will find enlightenment. If the great NeHe cannot help you come back and we will be glad to do so.

    Quote Originally Posted by Sharkadder
    Anyways thanks for the input
    Your welcome. But beware, perhaps I will be harsh the next time, just to show you the difference.

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2011
    Posts
    1

    Re: new to open GL - drawing 2d chart with GLUT and C

    You probably have solved or forgotten about this, but I found resource here which may be useful.
    http://ncu.dl.sourceforge.net/projec...gl-1.6-eng.pdf

    By the way, I agree the other response you got was unhelpful and rude.

Similar Threads

  1. Efficient Drawing with Open GL ES 2.0 (Android)
    By Ainigma in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-28-2017, 02:04 AM
  2. Open GL ES - Drawing bitmap
    By ychmin in forum OpenGL ES
    Replies: 1
    Last Post: 12-16-2010, 06:42 PM
  3. Open gl 3d Drawing IE 3D Editor
    By o9i8 in forum OpenGL: General
    Replies: 1
    Last Post: 02-07-2002, 02:25 PM
  4. Drawing Open GL in an arbitrary window
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-17-2000, 03:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean