Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Using OpenGL to implement data structures

  1. #1
    Newbie Newbie
    Join Date
    Dec 2012
    Posts
    2

    Exclamation Using OpenGL to implement data structures

    Hello there
    I need some help regarding a particular project... i need to implement data structures using c++ i know all the object oriented and c++ knowlegde that requires the implementation of structures like Link list, Stacks etc.... on console using Visual Studio 2010

    What i need help is i need to simulate all the actions like adding to a stack/list, deleting a node from a list/stack etc using OpenGL or any graphics that would be appropriate.

    In short i need help in actually simulating data structure concepts.

    Please if any one could guide me in this regard that would be helpfull.

    PS: i really dont know OpenGL

  2. #2
    Intern Newbie
    Join Date
    Nov 2012
    Posts
    33
    Could you be more clear on what you need help with? Are you trying to graphically represent data structures and their processes?

    OpenGL is just an API that lets you access your graphics hardware more easily (perhaps that's oversimplifying it somewhat, but you get the idea). You still program normally in your language of choice (C++ in your case?), but when you want to draw something (generally 2D shapes and images or 3D models) to the screen, you would call OpenGL functions. You don't program in OpenGL, per se.

    Based on your request, you seem to be coming from a basic foundation in console C++, and you're looking for the next step. If that's the case, reconsider what you actually need; there are many other GUI options worth looking at.

    If I missed the point entirely, please feel free to clarify.

  3. #3
    Newbie Newbie
    Join Date
    Dec 2012
    Posts
    2
    Thank you for your reply i will try to clarify my question. The thing is i am suppose to implement simulation of data structures functions using GUI . for example lets take link list i want to graphically show that a node is being created and then the next node is added and so on...

    Also i just want to know where do i start from even if its using some other GUI i need help with this.

    i hope you understand

  4. #4
    Intern Newbie
    Join Date
    Nov 2012
    Posts
    33
    This is a bit of a difficult project... how much time do you have to complete this? (And if you don't mind me asking, what is it for?)

    Your first step, if you haven't done so already, is to plan out exactly what you want to show on the screen for each data structure and function (say, fade in several squares, and slide them across the screen, then connect them with lines); it can be tough to represent the concepts graphically in any format. Don't think about how to do it in OpenGL, just think of it as planning out a movie.

    Once you've decided what you want to happen, I think you need to consider your time constraints and your requirements. OpenGL has a fairly steep learning curve; it can quite easily take you a few weeks to get a solid grasp of the basics. Of course, it varies from person to person (how familiar you are with graphics programming and math, or even just how persistent you are), but depending on your purpose, you may want to consider something else. OpenGL interfaces with the hardware for speed, so it's primarily used for real-time interactive applications, like games.

    It sounds to me like you need to make some sort of educational presentation; if so, you would probably get better mileage out of dedicated animation or presentation software, like Flash or Powerpoint. Those will allow you to plan out your graphics visually, instead of in code.

    Again, OpenGL is a graphics API. Once you know what you want to do, it's relatively simple to make it happen, if you know your way around OpenGL. However, it will take time and a lot more effort than I believe necessary.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •