Recently I have been focussing on how to put together `higher level` objects made from multiple curves and straight lines. An `object` in this sense is, for example, a solid filled irregular shape which might require a few or even many curves, straight lines, corners etc to complete it. The idea is to be able to build such objects with commands that `add a curve`, `add a point`, etc. When the shape is finally closed then it is ready for rendering. I’ve got most of the code done to make this happen.
The flow of object construction sort of goes like:
a) Create a bunch of control points which either will define curves or individual polygon vertices
b) Join then all together sequentially in a bunch of arrays ready for conversion to vertices
c) Pass the arrays to a system of `generators` which take the control data and turn it into vertices/triangles
d) Pass the vertex data to OpenGL for rendering.
Eventually this might be optimized, like a single function call that creates objects and tessellates and renders them with texturing and gradients all in one step. It could optimize the speed.
Another thing I’m working towards is filled gradients and texturing. I haven’t written any code on the gradients yet but I have some stuff for textures that is partially done. The idea with gradients is that you either are generating them in realtime as a triangle mesh with vertex colors, or you are doing that at some point and saving it to a texture ready for later texturing. Somewhere along the line there should be gradient and texture warping ie where you can drag around `vertices` within the gradient mesh to shape it how you want it. Of course there’ll be the usual standard gradients – linear, radial, spherical etc. I still have to think about how to translate a realtime gradient mesh into the vertex colors of a bezier shape – it will require some interpolation.
As far as texturing is concerned, it’s going to work much the same as the gradients – either applying a single texture across a shape, or making it out of a mesh, or even my `SuperTexture` which is a collage of multiple textures. Getting that to map to the vertices of a bezier shape is also going to be tricky, especially to deal with how the bezier moves and deforms, and especially if I do anything in 3D. Being able to manipulate vertices of a mesh which don’t map to vertices of a vector shape is the hard part. The first step is just to get a single texture mapped to a curved shape, which should be straightforward.
Gradually I’m working toward a simple editor where I can add tools to manipulate and generate shapes, apply textures, edit gradients and add other effects, so that I can actually start to use it toward a game. I am still aiming for a small game to be released this Christmas, but I am not sure there is time – only about 3 months to go!


Pardon me!