Jump to content
  • Advertisement
Sign in to follow this  
bleabox

OpenGL Tool for creating OpenGL primitives

This topic is 3149 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

I'm making a 2d game for the iPhone using OpenGL. Something I've realized would be nice to have while making this game is a tool that can create primitives and export them as either OpenGL code (in c), or to a format that OpenGL can read. What you should be able to do with this tool is creating OpenGL primitives, like polygons, triangle fans etc. You should be able to color the vertices. You should also be able to load images into the tool. First program that sprang to my mind was Blender, but I don't know how well that would work. Again, my game is 2d and not 3d. Also, the units should be in pixels. I don't know what units blender use. Anyone got any tips for me? Thanks

Share this post


Link to post
Share on other sites
Advertisement
OpenGL itself does not read any formats. It only understands arrays of vertices, normals, texture coordinates, etc. These are common to all model formats, so it boils down to which format supports the features that you need for your game, and which one you are comfortable importing from and exporting to. Typically you will design the meshes you want in the modeling program, export the information into a file that you will have to read in your program.

Its up to you to read the file and send the relevant information from it to OpenGL, I'm fairly certain that no programs will generate the actual OpenGL code for you.

Blender seems like a fine choice of a modeling program, although it doesn't really have any concrete units. You can imagine that each "blender unit" is one pixel, but then it is also up to you to set that up correctly in your game engine to get the proper scale factor.



Share this post


Link to post
Share on other sites
If in Blender your units are {1.0, 0.0, 0.0} for some vertex and you export it, then that is what you get. Export to .obj if you want since it is a simple format.

Share this post


Link to post
Share on other sites
Quote:
Original post by V-man
If in Blender your units are {1.0, 0.0, 0.0} for some vertex and you export it, then that is what you get. Export to .obj if you want since it is a simple format.


Thanks, this is what I discovered too. I made some python scripts that take obj-files and do things with them.

Oh, blender is such a nice tool. Absolutely incredible that it's free.

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!