24 August 2011

Ogre Beginner Tutorials 4-6

Well, it is a little later then I intended to post, I was hoping to makes this post in the early morning, but better late then never. The reason why is because the first two tutorials I started with after the last post only took a day combined. The picture left is from the fourth tutorial. Tutorials 4 and 5 are how Ogre handles inputs, unbuffered and buffered respectively. Unbuffered inputs look to see if a frame listener has been triggered since the last frame. This is very useful for commands like movement and any other continuous type of input, but requires an interesting way to get around input you only want to be triggered on/off, requiring a boolean be switched to determine if the key or button was in a previously pressed or released position.

Tutorial 5 handles this a little more gracefully. Buffered inputs have the frame listener call a pressed or released function for each input. This handles the toggles well and since it is calling the pressed function every frame, it handles continuous inputs fairly well also. A delayed reaction, much like what I would want the laser fire to act as, is also fairly simple since it just involves checking if the key is still pressed from a certain amount of time ago. This still required a variable to keep track, and probably a little more work to make sure it is not exploitable, but overall both types of input worked fairly well.

Tutorial 6 was not as kind. This tutorial is setting up an Ogre program from scratch and only using standard libraries to fill in the holes. The basic process is to create a Root object, define the resources and render system, and initialize resources. After that the key things to do next are create the scene, set up third party libraries and plugins, attach the frame listener and associated tasks, and set up the render loop. These can be completed in any order unlike the first four. What gave the biggest problem was for some reason when I tried to create the resource import system, which looked fairly easy, the program would crash, not knowing what to do with the zip files. So after trying to re-install the zip handling library, and re-installing Ogre from scratch, I was still getting the same error. Not sure what was different but after copying in their code and compiling the program worked fine. Only other hang up was on setting up the OIS input system, which for some reason did not like that I had not fully capitalized the word window, giving a runt time error.

So this only leaves one more Beginner tutorial ,then I can begin some of the more advanced work, but so far it seems, as long as I can get the actual programming down in C++, like this will be the probable graphics engine.

No comments:

Post a Comment