Friday, February 28, 2014
Wilderness Tour
Irregularly I'll pass some time by writing. Not just the dull explanations I offer up on this blog, but creative stuff. Short stories or story fragments for the most part, and typically connected with some tabletop game I'm involved in. Though from time to time it's just a story that I just felt like writing down, this is one of those.
Monday, February 24, 2014
Bouncing Polygons!
Finally! I've got stuff moving on the screen. It seems that I was over-thinking things with my previous attempts at getting the cube to move around. All I really needed to do was pass the data into the vertex shader and let it handle the rest. Whatever, It's all working now.
With this we wrap up two topics. Textures will be done; well more done, my texture code was done after the UV coordinates. As well as transformations and animation. Or at least the basics of animation are done, this just shows how to move and distort meshes, actually making it look like real movement takes a bit more planning and effort.
With this we wrap up two topics. Textures will be done; well more done, my texture code was done after the UV coordinates. As well as transformations and animation. Or at least the basics of animation are done, this just shows how to move and distort meshes, actually making it look like real movement takes a bit more planning and effort.
Friday, February 21, 2014
Matrix math and OpenGL
I'm still working out how to apply these transforms in my model class. I think it'd be best if I found a way to pack the necessary information into a uniform buffer when rendering an object, this would allow the shaders to perform the necessary transformations. The trick of course is to pack the data in such a way that everyone can make sense of it, and that's where I'm stuck at the moment.
Regardless, of my inability to copy data legibly I can still explain the core of what needs done. OpenGL uses matrix math to perform transformations on your models. These transformations are what allows in to move around on the screen. So let's talk about matrix math.
Regardless, of my inability to copy data legibly I can still explain the core of what needs done. OpenGL uses matrix math to perform transformations on your models. These transformations are what allows in to move around on the screen. So let's talk about matrix math.
Monday, February 17, 2014
Texture UV Coordinates
Last time I threw a texture onto a cube and was very unhappy with the results. Since the point of the post was to load a texture let's start by fixing that. In doing so we'll discover two details. First with all the data being loaded from the OBJ file we can fix the texture without touching a single line of code. Secondly when I slapped together that texture I did a bunch of things wrong.
Friday, February 14, 2014
Loading Textures in GL
I've got colored polygons on the screen. Flat colors like that really aren't all that visually appealing. I'm sure you could arrange enough of them to make an interesting picture, but it seems like a lot of work. What would be a lot easier is if we could just take some image data and stretch that across the polygons.
Monday, February 10, 2014
My Model Class
Next thing to clean up is the code for managing models. What it needs to accomplish:
- Load all necessary information from OBJ files
- Remember the buffer objects to store the data needed for rendering
- Track the changes to the model data and only update buffers when changes happen
- Perform all the work needed to render the model
Once again this class will likely be kept in a large array, one element for each model I have a need of drawing. Eventually this class will need extended to be able to manipulate the object, or at least track transformations that it'll need when rendered. I haven't dealt much with movements yet, but that's going to have to happen soon.
Friday, February 7, 2014
My Shader Class
In an effort to start organizing the code needed in an OpenGL program I began building a few classes to manage some of the work. The first one I put together was the GLShader class. It's job is the following:
- Remember which files hold the source code for a particular shader
- Be able to load the source code from file then compile and link the program
- Remember a list of all Uniform and Attribute variables that this shader will use
- Assign specific ID's for those variables when the shader is compiled
Monday, February 3, 2014
Loading Models
I've gotten really annoyed with the large blocks in my OpenGL programs that fill arrays with vertex information. What I need is a way to load this sort of data from a file, then I'll be free to use more interesting models without gumming up my code with hundreds of lines of vertex coordinates. Perhaps a file that's easy to read, like say plain text. It ought to provide all the details I want too; vertex coordinates, UV mapping for when I get around to textures, and maybe normals should I ever play with lighting. Fortunately just such a thing exists.
Subscribe to:
Posts (Atom)