Members - Reputation: 105
Posted 18 December 2012 - 03:22 PM
So right now I have taken a basic graphics course at my University and I have a decent understanding of the math and very basic functions in OpenGL. I also have a really solid background in c++. The problem I have run into is I am having a hard time taking the step to handling multiple objects. If I use the old method of drawing objects in OpenGL that did not use buffer objects I have been able to get things move around in a relatively easy to understand way, but I can't figure out a good way to do that using buffer objects.
For example I have created a basic static 3D environment that the user can "walk" around in and uses various transformations to adjust the scene when the person is moving and apply a perspective, but say if I want to have other objects in the scene moving around, what is a good way to add those in and manage them. Do I want to create multiple buffer objects and then apply different transformations to each of them?
I probably will try to use these ideas in a 2D game first just to simplify things, but I have had trouble finding a good tutorial that shows any way to make the jump from having one object to many without just using an existing game engine.
Any good tutorials on managing objects?
Any simple examples or games out there that I can learn from the design?
I'm really interested in how game engines work so I don't plan on trying to make a really high quality game, I just want to learn and build up to do some more interesting things.
Members - Reputation: 696
Posted 20 December 2012 - 01:53 PM
Yes. To keep things simple, that is perfectly acceptable way to handle things.
Do I want to create multiple buffer objects and then apply different transformations to each of them?
If you end up rendering lots of little buffers (and rendering performance becomes an issue), you could transform all the vertices on the CPU and batch them together into a single draw call. You could also look into other methods of OpenGL geometry instancing. This typically only works if all objects can be rendered with the same shader and render state.