I've been looking all over the place for books on DirectX and OpenGL. But I am not getting what I'm looking for. I've programmed a few text-based RPGs and want to learn to program graphics but can't find a sufficient source. Suggestions?
I've been looking all over the place for books on DirectX and OpenGL. But I am not getting what I'm looking for. I've programmed a few text-based RPGs and want to learn to program graphics but can't find a sufficient source. Suggestions?
In both OpenGl and DirectX, I know how to render objects and do the typical transforms. I don't know how to render external models, and print images to the screen however. I am kinda lost!
You need loaders for those specific models/images to import them inside your game , either get open-source ones for the code or build your own. But the 2nd way requires a deep understanding of each specific file format.
For example:
Wavefront .obj file
BMP file format
Devoted my life to programming...
Depends on what you want to do, but I'd suggest using something like the SDL. It's a framework that handles input/output and integrates well with OpenGL; it can load BMPs right up front and with SDL_image you get a dozen other formats (including PNG and JPG). So that's textures taken care of. For models, you can hard-code some basic ones, but it wouldn't hurt to get an MD2 loader or (Wavefront) OBJ loader. There are many free loaders for both of those formats on the internet. You can find tons of free models too (particularly for MD2), and it doesn't take long to install blender and try creating a few models of your own.
MD2 supports animation and it's really meant for game characters. OBJ is a nicer format and it's easy to export to and write your own loader for. Take your pick.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Ok. I'll into the stuff. I just recently made my own sprite displaying routine. Thanks for the advice. I'll post if i run into any more trouble.
For OpenGL i would recommend this set of tutorials to get up and running quickly: OpenGL
It doesn't go as indepth as one would like at times but you get a good general grasp of how to do things (and maybe more importantly, it covers the newer versions of OpenGL that don't use the fixed function pipeline).
This looks to be a more indepth guide to OpenGL: Learning Modern 3D Graphics Programming (haven't gone through it myself but from the small parts i've read it seems to be rather good).