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 5 of 5

Thread: Level editor

Hybrid View

  1. #1
    Newbie Newbie
    Join Date
    Jun 2013
    Posts
    1

    Level editor

    Hi All,

    I am quite new to OpenGL and 3D development. I have done a few tutorials and built a room using quads however i was wondering what is the easiest way to go about building full levels e.g multiple rooms and corridors without hard coding the actual vectors.

    Any help would be great.

    Thanks

    Jonathan

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    You could look at using some sort of XML text file to hold the descriptions. There is an open source library to read these files called TinyXML

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    Well, there are a host of file formats for the description of 3D scenes. For instance, game developers will often define their own proprietary format tailored specifically to their needs. There are however, industry-standard formats like COLLADA which are open and widely supported. Content exported to such formats is created in various tools, e.g. Blender or 3D Studio Max.

    You can always specify your own format and, for instance, write an export script for an existing tool, e.g. a python script for blender, that exports directly to your format and then write import code used by your application to process scene contents at runtime.

  4. #4
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    490
    Whether you define your own format or use an existing format, bear in mind that a game needs data for more than just rendering, e.g. collision, path-finding, trigger regions for scripts, etc.

    For complex scenes, you can't just render everything every frame, you need some sort of culling system so that you only render parts you might be able to see. This often relies upon data which is stored as part of the level. But with modern hardware, you could probably render an entire Quake level without needing any form of culling.

    If you just want to take the next step beyond hard-coded data, the Wavefront OBJ format is very simple and can be written by most modelling software. Searching for "OpenGL" and "OBJ" will provide many hits (of varying quality; it's popular "my first OpenGL-related blog post" material).

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    716
    Yes, unfortunately since OBJ supports different indices for each vertex attribute it does not directly map to OpenGL. Of course there is no end of threads explaining solutions on this forum

Posting Permissions

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