Jump to content
  • Advertisement
Sign in to follow this  
markjco

OpenGL Automatic Object Rendering function or library

This topic is 3029 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, Does anyone know of a function in OpenGL OR an library related to OpenGL that can automatically render an object given a set of points? For example: When I read data from a text file that contains a set of vertices in a sequential order generated by a 3rd party software, I will have to store those data into an array which will be fed into the function that will automatically render the object. This is the same as drawing an object in OpenGL, where you declare a set of vertices and then OpenGL would just connect them thus creating a polygon. I want to find a function out there or a library that would do this without me actually creating the vertices... The general idea is that the points would be generated by a 3rd party software and then when it is fed to the program the object would be rendered in OpengGL. Thanks in advance. Regards,

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by markjco
This is the same as drawing an object in OpenGL, where you declare a set of vertices and then OpenGL would just connect them thus creating a polygon. I want to find a function out there or a library that would do this without me actually creating the vertices...

So what does "without me actually creating the vertices" mean? OpenGL is a rendering package, not a modelling package; it isn't interested in the creation of vertices. It is just happy with a finished array of vertices, as long as the array is build in a way that can be understood by OpenGL. Look at VBOs (vertex buffer objects) for this purpose.

Of course, you have to open the file, load the vertices, and pack them accordingly to VBO requirements. It is not possible to "automatically" do this, especially without any further knowledge. First there is the file format in which the vertices are stored. There are dozens of possibilities. Next, vertices define a mesh for a model, but they don't define its relation to the world (position, orientation, size). Third, there is further no information whether the vertices are to be used for triangles, quads, or any polygon with even higher count of corners, or triangle or quad strips, or whatever else is possible. "A set of points" may also mean a point cloud building a surface from e.g. 3D scanning.

In other words, IMHO your question is much too vague to be answered in a satisfying way besides "look at VBOs".

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!