Saturday, March 31, 2012
START
And so it begins again. GAM 575 will take what we've learned in the last class and add a whole new arsenal of tools to our engine. I'm most excited to jump into adding animation data.
Wednesday, March 14, 2012
Tuesday, March 13, 2012
Lookin' Good .... Lookin' Real Good.
Alright then. I'm just about done. I've got everything I wanted to put in my graphics system up and running. I discovered a flaw in my collision tests once I actually made the cube move (only the sphere was moving before) but I patched that up real quick. I also added a spin and an orbit to each object's transform matrix. I did a final clean up of all my files as well. I'm happy with where it's at.
The only thing I have left to do is set up and record the Demo. This might take some handy work but I think it should work out just fine. I'm going to add in a second translation real quick so that I can make a couple of scenes and push them around to create what is essentially the scenes of my demo. then I'll be able to set up 3 or 4 cameras at that translation. I might also add in some additional camera controls but I just don't think it's worth it at this point. Tomorrow should be a piece a cake (except I'll have that paper to write and my other final to study for. Oh, the life of a grad student. )
Good Night
-A
The only thing I have left to do is set up and record the Demo. This might take some handy work but I think it should work out just fine. I'm going to add in a second translation real quick so that I can make a couple of scenes and push them around to create what is essentially the scenes of my demo. then I'll be able to set up 3 or 4 cameras at that translation. I might also add in some additional camera controls but I just don't think it's worth it at this point. Tomorrow should be a piece a cake (except I'll have that paper to write and my other final to study for. Oh, the life of a grad student. )
Good Night
-A
Back on Track
So I got a little bit derailed last night with the Bulls game which means tonight will be a bit of a crunch time. I have checked a few more items off the list since the last post so let's talk about those really quickly.
I've got my object culling working pretty well at this point. My sphere has been changing color as it passes through a sphere rather successfully for a while now and I finally got this code transferred over to the sphere object itself. I've inserted a check in the rendering and graphics objects files that essentially looks to see if the collision test passes and draws or doesn't based on the results. The weird thing about this one is that there isn't really an easy way to tell is it's working or not. I suppose that what the color change function accomplishes. I've also done some major cleanup on my files. They all had a few artifacts from older generations in terms of what was included and what was externally declared. I got rid of what wasn't necessary anymore and created a couple of header files to make the includes look nicer. It's looking pretty spiffy. I may need to take a run through my code and beef up some of the comments though.
I've only got a few real requirements left and then it's on to making improvements. First thing I'm going to tackle is the texture manager. for now I'm just going to get it running and hope for the best so I can get credit for it. I think if I were to be making my engine available for sale this manager would be virtually unseen to the user. I've been using the object manager to do the same work I'll have the texture manager do (load and delete textures) and I really like that as a simple interface. My object's calls to load or delete a texture will probably call the texture manager which will take care of counts and do the necessary actions and then return a pointer. beyond that I don't really see what it's going to need to do. It's not very robust and I've had some conversations with Ben (a classmate) about how to make something a little faster/more robust. He's clearly got a good sense for writing code that isn't going to break down. That should be the last requirement. I could technically start my demo right from there.
Then it's on to improvements. I'd like to add in a better means to get transformations applied to objects, or at least additional options. I think I'll make one function that takes a matrix and applies it directly to the object;'s transformation. I also like the options I have on the sphere, so I'll tweak those a bit and copy them over to my other primitives. In the future I could imagine just sticking some of them into the GraphicsObject class so that all future objects have the same basic functionality.
I'll likely improve the User interface to allow for the camera to do more than just pan left, right, forward and backward. but I'm not real sure on that one. This one will be an "if I have time" sort of thing.
This is a longer post but when I get it all written down it doesn't seem like tonight will be nearly as bad as I had originally thought. It's amaizing how far I've come in the last week or so. Let's get crackin'
-A
I've got my object culling working pretty well at this point. My sphere has been changing color as it passes through a sphere rather successfully for a while now and I finally got this code transferred over to the sphere object itself. I've inserted a check in the rendering and graphics objects files that essentially looks to see if the collision test passes and draws or doesn't based on the results. The weird thing about this one is that there isn't really an easy way to tell is it's working or not. I suppose that what the color change function accomplishes. I've also done some major cleanup on my files. They all had a few artifacts from older generations in terms of what was included and what was externally declared. I got rid of what wasn't necessary anymore and created a couple of header files to make the includes look nicer. It's looking pretty spiffy. I may need to take a run through my code and beef up some of the comments though.
I've only got a few real requirements left and then it's on to making improvements. First thing I'm going to tackle is the texture manager. for now I'm just going to get it running and hope for the best so I can get credit for it. I think if I were to be making my engine available for sale this manager would be virtually unseen to the user. I've been using the object manager to do the same work I'll have the texture manager do (load and delete textures) and I really like that as a simple interface. My object's calls to load or delete a texture will probably call the texture manager which will take care of counts and do the necessary actions and then return a pointer. beyond that I don't really see what it's going to need to do. It's not very robust and I've had some conversations with Ben (a classmate) about how to make something a little faster/more robust. He's clearly got a good sense for writing code that isn't going to break down. That should be the last requirement. I could technically start my demo right from there.
Then it's on to improvements. I'd like to add in a better means to get transformations applied to objects, or at least additional options. I think I'll make one function that takes a matrix and applies it directly to the object;'s transformation. I also like the options I have on the sphere, so I'll tweak those a bit and copy them over to my other primitives. In the future I could imagine just sticking some of them into the GraphicsObject class so that all future objects have the same basic functionality.
I'll likely improve the User interface to allow for the camera to do more than just pan left, right, forward and backward. but I'm not real sure on that one. This one will be an "if I have time" sort of thing.
This is a longer post but when I get it all written down it doesn't seem like tonight will be nearly as bad as I had originally thought. It's amaizing how far I've come in the last week or so. Let's get crackin'
-A
Sunday, March 11, 2012
Sphere VBO
I finally got the sphere vbo up and running. Things are really starting to come together here. I've still got a lot of work ahead so I'll keep this short. I owe most of the work to Derek. He posted his sphere VBO data and I used that data for my sphere. It was a bitch to get it running though. I couldn't get the thing to load for the longest time. He had some methods that weren't compatible with my system because of his collision testing. I commented out his collisions and will insert my own method for that. He also was attempting to load a texture that I didn't have saved in my folder and so for a while the object was being rendered and I couldn't see it. I think I'll work on reworking the matrix transformations next.
-A
-A
Saturday, March 10, 2012
Collision System
So it took almost a whole day of debugging and trying different things but I finally go the ball and box collision system working. I thought my math was right, and for the most part it was, but it took me a long time that my local variables weren't initializing the way I thought they were. I was trying to hold the position of the sphere in an object on my SphereObject but this just wasn't working and I didn't know it right away. I was using the debugger to pour through different areas of my code to figure it all out. so instead I used the object's LocalToWorld matrix to get it's current translation and now we are in business. What a hassle that was! alright... back to work.
VBO's!
Well it's just about time to call it a night here. I've gotten through setting up VBO's for the pyramid (this was done for us, so not as impressive) as well as the cube. This took a good amount of planning. I had to spend a good amount of time coming up with how to lay out the triangles. I decided to set up a triangle strip and this ended up being not nearly so bad. I accidentally flipped the last two verts and this took some time to figure out. beyond that it worked out well. I think I'll post my finished product in the common directory for others to check out. .... I wonder if anyone came up with a good VBO for the sphere.
Friday, March 9, 2012
Big Break Through
So I know it's only been a couple of minutes since the last post but I just had a large breakthrough I thought it was important to post.
One of the main reasons I had been struggling to get past the collision detection was because of opacity. We are supposed to try and get a sphere to pass through a cube and change color as it does using the collision detection math we had in class. The first thing I wanted to do was draw a cube with an object inside of it and make sure I could see the object through the cube.
I got both of the objects to show up on the screen in the right spots but for some reason my cube wasn't see through despite a proper amount of alpha being entered into the shader. I had gone through our text book and was sure I was doing what I needed but for some reason the cube was still looking solid. basically what you're supposed to do is draw the "inside" object first and then draw the"see through" object last. This means that the shader will blend the colors together creating the desired effect.
So I added my pyramid first and then my cube right on top of it, following the logic laid out. This is where I went wrong. my object manager does not draw the objects they were added to the list. adding the object to the manager pops it on to the front of the list, but then the draw method starts at the beginning and walks through the list. this means I added my pyramid (to the front) and then my box (again, to the front of the list) and when my object manager began it's drawing it started with the box and then the pyramid so no blending was actually done.
now that I have figured this out my collision detection should start to really be much easier to get going on.
-A
One of the main reasons I had been struggling to get past the collision detection was because of opacity. We are supposed to try and get a sphere to pass through a cube and change color as it does using the collision detection math we had in class. The first thing I wanted to do was draw a cube with an object inside of it and make sure I could see the object through the cube.
I got both of the objects to show up on the screen in the right spots but for some reason my cube wasn't see through despite a proper amount of alpha being entered into the shader. I had gone through our text book and was sure I was doing what I needed but for some reason the cube was still looking solid. basically what you're supposed to do is draw the "inside" object first and then draw the"see through" object last. This means that the shader will blend the colors together creating the desired effect.
So I added my pyramid first and then my cube right on top of it, following the logic laid out. This is where I went wrong. my object manager does not draw the objects they were added to the list. adding the object to the manager pops it on to the front of the list, but then the draw method starts at the beginning and walks through the list. this means I added my pyramid (to the front) and then my box (again, to the front of the list) and when my object manager began it's drawing it started with the box and then the pyramid so no blending was actually done.
now that I have figured this out my collision detection should start to really be much easier to get going on.
-A
BSR - CHECK!
You can already check one of the items off my list. I've downloaded the BSR recorder and got it running. I even tested it out with a quick 5 second clip. It was easy to use and free to download. I recommend you give it a try if you want to make a demo of your own. What a relief. Now back to work!
Quick Planning Session
So I had to set engines down for a little while so that I could work on some projects for my AI class. Of course this means that yet again I am behind and will really need to buckle down this weekend to get the demo all finished up. I had a pretty good start before I set it down so I'm not exactly screwed but let's just say this weekend is going to be rough. I took the last half hour or so to plan out what is left to be done. I think I'll get it all typed down here on the blog so I feel good about checking things off the list. I'll also probably make a post as those things get checked off.
Here's my list of TODO's:
GRAPHICS OBJECTS:
Finally I'll have to decide weather I want to load my objects from a file or create a Texture manager (I'm already going to do a camera manager). Both of those tasks scare me so I'll probably save them for last. The file thing was laid out in class, but I just don't really have any level of comfort with this. ...maybe it's now or never?
So that's my list of tasks for the weekend. It's a long one but I'm thinking I can pull it off. If I don't have that thousand yard stare by the end of this weekend I don't know what will do it.
-A
Here's my list of TODO's:
GRAPHICS OBJECTS:
- get one more primitive in there (I've got a box, a pyramid, and a sphere. I'm thinking about tossing the sphere because of the pain the VBO is going to be)
- Turn my primitives into VBO's (I'll likely be taking another look at class for some procedure on this.)
- add some functions to the objects for:
- setting the transformation
- setting or adding OPENGL states (??) (I'm thinking this may have to hacked into some other function)
- setting the rendering state
- I'm going to add in a camera manager. It should be fairly quick and dirty.
- I plan to have the manager create a list that points to each camera, initialize a new camera, and be able to cycle through them
- I'll probably have to use the keyboard for the cycling. I'm contemplating a class or maybe just a .cpp file that handles reading the keyboard.
- this one has been giving me a tad bit of trouble. I think the main problem is that I was attempting to get to far ahead of myself. I'll start with getting a sphere to sway back and forth through a box, then I'll have it change color as it goes through.
- The math on this one seems fairly straightforward. It's likely going to require that I add in a few variables to my box object so I can have an easier way to call the necessary normals.
- I've never recorded a demo before so this one may be a bit more of a hassle than it should be. I'll have to download BSR (who knows what that is?) as suggested by Keenan and test it out a bit. I'm hoping this doesn't snag me up too much.
Finally I'll have to decide weather I want to load my objects from a file or create a Texture manager (I'm already going to do a camera manager). Both of those tasks scare me so I'll probably save them for last. The file thing was laid out in class, but I just don't really have any level of comfort with this. ...maybe it's now or never?
So that's my list of tasks for the weekend. It's a long one but I'm thinking I can pull it off. If I don't have that thousand yard stare by the end of this weekend I don't know what will do it.
-A
Thursday, March 1, 2012
Far too long since the last post
As you can see from the title it's been entirely too long since my last post so I better squeeze something in here. The graphics system has gotten me really behind in terms of getting any actual code cranked out. I've been doing a lot more of trying to follow Keenan's refactoring. This has proven to be rather helpful because I think going through the various changes he's making are helping me to understand the changes and know some more about what's happening behind the scenes with this openGL stuff. You really have to dig in and research what some of these functions do before you can try to write a function on your won that does the same thing.
I am finding that while I really am learning a lot there is A LOT left to learn. I wonder if I were to go to job interview tomorrow how I would stack up. I don't feel good about my answer yet. I've spoken to Keenan about this and he's been a big help in this area. He suggested I check out GOTW and purchase a couple of books to brush up on and strengthen my C++. I'm going to take his advice to heart and get started right away. I ran over to Amazon and ordered the books he suggested (he suggested them in class too, but I got a better look at them in his office.) and they should be here soon. As soon as finals week finishes up I'll get cracking on the guru exercises. He's given me a daunting amount of work but I need to remember to baby step through it. One "Guru" a week plus one chapter a week on those books and I'll be a better programmer in no time.
Any who, some more about game engines. I'm not nearly as concerned as I think I should be about this whole graphics section. I'm able to follow his refactoring and his lectures pretty easily. I guess we'll see how that goes when I actually put some of this stuff into practice. Much of this weekend will be spent working on that demo amongst my work for my other class (oh, and going to my real job too). ugh... I always dread finals week.
-A
I am finding that while I really am learning a lot there is A LOT left to learn. I wonder if I were to go to job interview tomorrow how I would stack up. I don't feel good about my answer yet. I've spoken to Keenan about this and he's been a big help in this area. He suggested I check out GOTW and purchase a couple of books to brush up on and strengthen my C++. I'm going to take his advice to heart and get started right away. I ran over to Amazon and ordered the books he suggested (he suggested them in class too, but I got a better look at them in his office.) and they should be here soon. As soon as finals week finishes up I'll get cracking on the guru exercises. He's given me a daunting amount of work but I need to remember to baby step through it. One "Guru" a week plus one chapter a week on those books and I'll be a better programmer in no time.
Any who, some more about game engines. I'm not nearly as concerned as I think I should be about this whole graphics section. I'm able to follow his refactoring and his lectures pretty easily. I guess we'll see how that goes when I actually put some of this stuff into practice. Much of this weekend will be spent working on that demo amongst my work for my other class (oh, and going to my real job too). ugh... I always dread finals week.
-A
Subscribe to:
Comments (Atom)