-1

For a while now I have been searching for a good tutorial which teaches you OpenGL for 2D (bitmapping / topdown game) with the ability to add 3D characters, sadly I have yet found a good tutorial.

Almost 2 years ago I have finished the SDL tutorials for 2D from http://www.sdltutorials.com/ , but now I want to be able to add 3D characters to a topdown game, so I have to go with OpenGL.

So, if you know of a good tutorial which teaches you the basics of 2D OpenGL with inclusion of being able to add 3D characters and objects, let me know!

Here is an example of what I would like to be able to create: https://i.stack.imgur.com/EXtGm.jpg (Game: Gun Bros), as you can see, the world is created in a 2D bitmap-system, but the characters are in 3D.

And here are a couple of tutorial websites I have found myself but not 100% sure if any of these really could help me:
www.videotutorialsrock.com - Pure 3D programming.
lazyfoo.net/tutorials/OpenGL/ - Pure 2D programming (This is the basics I guess I need for the 2D part)
www3.ntu.edu.sg/home/ehchua/programming/opengl/CG_Introduction.html - Also 2D, but I haven't taken a look at it yet.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Nishok
  • 3
  • 2
  • You mean 3D 'without perspective', e.g., orthographic or [cavalier](http://stackoverflow.com/questions/6100614/opengl-oblique-projection) projections? – Brett Hale Oct 22 '13 at 22:06

2 Answers2

-1

If you want to dive into openGL, I would recommend the orange book. We used it in class, and it has a lot of really good information. If you're developing this for the web, I would highly recommend this webGL tutorial. I learned a lot from that tutorial. As far as the specific implementation of a top-down game, I've not run across a tutorial. You could probably use very simple .objs and then do some bump mapping onto them. Mapping textures onto 3d objects requires uv mapping. For uv mapping, I'm a fan of this uv tutorial

Peter Klipfel
  • 4,958
  • 5
  • 29
  • 44
-1

I wasn't able to find any tutorials for what your looking for, but I do have an idea to accomplish it.

Currently in the 2D tutorials you have an orthographic camera. And you can keep of everything you've done so far with it.

To impose 3D graphics on top of that you would need a camera specifically for the 3D models and a perspective camera.

Render your 2D as you normally do, then draw the 3D scene on top of it. I can only assume that in your 2D scene you are not using a depth buffer, but if you are you will need to clear it before rendering your 3D scene.

glClear(GL_COLOR_BUFFER_BIT);
SetOrthoGraphicProjection();
Draw2DScene();

glClear(GL_DEPTH_BUFFER_BIT);
SetPrespectiveProjection();
Draw3DScene();

And that should at least get you started.

tamato
  • 838
  • 7
  • 15