Showing posts with label opengl. Show all posts
Showing posts with label opengl. Show all posts

Sunday, July 26, 2009

Blender and Irrlicht

After finishing going through The Red Book and trying to start writing a small interactive scene, I immediately knew that raw OpenGL would take way too long to use in a game. I'd need an engine instead. For one thing, trying to create detailed models and scenes in a graphics API like OpenGL is probably impossible, not to mention really stupid, what with all the powerful tools out there. It'd probably take a month to perfect a single model that way. And no, I never seriously considered doing so.

So I knew I either had to use an engine made by someone else, or make my own. From looking at some game engines that other people have spent some time on, and discussions on the Internet among game designers, I know that as a graphics and game design noob, creating my own engine would be purely educational. Meaning it would inevitably suck. Now I'm glad I learned the basics of OpenGL, since it taught me a bunch of important 3d graphics concepts. But it's one thing to learn basic concepts and another to spend months of my life trying to piece together a decent 3d game engine. Since my goal is to be creative rather than travel these much trodden roads, it wasn't a hard decision to use someone else's engine.

I'd heard of the 3d engine Irrlicht before, and it seems very simple to use. So I'm gonna do that. Another one is OGRE, which sounds more powerful but with a higher learning curve.

More important is the ability to import 3d models into the engine, definitely one of my favorite features. The free 3d design program Blender is quite popular. It falls under the category of apps like Maya and 3d studio max but is free. And there's a really nifty tool called irrb which converts blender scenes and data to Irrlicht format. Perfect! (I used Blender to make the crappy "yo man" pic at the top of this post, following the "Blender 3d: Noob to Pro" tutorial. It didn't take very long at all. I have to say, though, learning Blender requires patience, as the interface is loaded with options and hotkeys and it's important to memorize these things.)

Furthermore, there's an effort to port Irrlicht to the Wii -- Wiirrlicht. Sweet.

Unfortunately on platforms like Android, it's gonna be a little harder to find a free engine to use, so I'll probably have to end up hacking together a simple one when I get serious about coding for that. I think iPhone has a few 3d engines to choose from though. Hopefully following the release of the Android 1.5 NDK, we'll see more useful engines ported over.

Tuesday, June 30, 2009

OpenGL

Rotating cube
I finally got around to learning OpenGL in earnest. My two resources are The Red Book (old online version) and NeHe's OpenGL Tutorials. I started looking at OpenGL stuff several months ago but got caught up in school and things.

If you take a look at NeHe's guide, don't be scared away by the first tutorial, which is more of a Windows lesson than an OpenGL lesson. The subsequent lessons are shorter and more pertinent to OpenGL.

I'm reading through The Red Book right now. Since it seems more organized than NeHe, I want to use it to get the concepts down before doing NeHe's tutorials. I'm on chapter 3, dealing with the modelview and projection matrices. I decided to take a diversion halfway through the chapter and write some small functions involving changing the view based on polar coordinates. It took awhile to get it right, despite the book itself being written well enough to grasp the concepts fairly quickly. Here I remind myself of the first rule of a CS degree: Never stop coding. And going through these tutorials I recognize the importance of thinking on my own and writing code aside from what's given in the tutorial. Otherwise a lot of time would be wasted later, when I'd have to go back and reread things more closely.

Probably what made me go back to learning OpenGL was knowing that I could do some OpenGL stuff on Android. Android uses a special version of the OpenGL API called OpenGL ES, catered toward embedded systems. I also know that the Wii and Nintendo DS homebrew libraries have OpenGL-like graphics APIs. In fact tons of platforms use similar APIs, so it's definitely worth learning.