C'è una middleground tra la scrittura cruda OpenGL rispetto all'utilizzo di un motore di gioco in piena regola?

StackOverflow https://stackoverflow.com/questions/1993619

  •  22-09-2019
  •  | 
  •  

Domanda

Sto giocando intorno con OpenGL e mi sto trovando a scrivere codice che mi sento come se non avrei dovuto scrivere.

GLU e GLUT sono belle, ma non proprio quello che sto pensando di.

  • Codice per caricare obj modelli (vertice e vettori normali) da Blender e renderli.
  • Codice in materia di rilevamento delle collisioni.
  • Codice per le cose di navigazione / fotocamera.
  • Codice per la generazione del terreno semplice.

Ma allo stesso tempo mi sento come un motore di gioco in piena regola è più che ho bisogno.

Ci sono buone biblioteche costruite in cima a OpenGL che avrei potuto sfruttare, forse per creare giochi relativamente semplici? Non necessariamente bisogno di tutti gli elementi sopra elencati. Questi sono solo esempi di quello che sto pensando di.

È stato utile?

Soluzione

Yes.

I can't be more specific as I don't write my own game engines but I do have a list of libraries online at this location, most of which sit below being a full engine.

Altri suggerimenti

Ogre
Irrlicht
openscenegraph (replaces performer)

Depending on how much you need, one of these toolkits / libraries might suit your purpose.

  • GLUT - OpenGL Utility Toolkit
  • Ogre3D - OGRE Object Oriented Graphics Library
  • Open Inventor - OpenGL toolkit for scene management created by SGI
  • Performer - OpenGL toolkit for real-time rendering created by SGI

I learnt my opengl stuff from GameTutorials and Gamedev. Unfortunately gametutorials are no longer a free selection of tutorial (there's some examples) but they were good. Coupled with SDL, you would have code to do everything you wanted - and you'd be able to understand what is going on under the covers, something I find is very useful later on (if, for example you wanted to write HTML5/WebGL code later).

A lot of the game engines aren't as well documented as I'd like (well, weren't a few years back when I was looking), but they might still do what you need. Sourceforge has many, including Ogre3d, Irrlicht, and CrystalSpace.

In general I agree with your sentiment. There is a school of thought that says that programming should consist of pluggable modules. Once youve written an OpenGL app, you should be able to grab a model loader, and/or a skeletal animation engine and plug them in.

The depressing thing is, most of the game engines on that list (that Ive looked at) are all or nothing propositions. They provide an entire framework and do not really take into account the more common real case scenario.

That said, all is not lost. A lot of those engines package up a number of other 'utility' libraries into their distribution. With a bit of patience it is possible to piece together the component libraries yourself: OpenAL for the sound, Freetype for font rendering, libpng, libjpeg etc for image codecs

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top