Because I want to learn how to do 3D programming, I thought I would start with something that could be useful for other stuff later on, and is fun to do - build a low-poly text renderer.
Right now, I've just designed my own font that consists of no more than five triangles for each (capital) letter - using the form of the triangle to make an Asian style font that looks kinda fun.
Each of these can be scaled both width and height, and the width of the end of the triangle can also be specified to adjust the weight of the font. Currently, it works like this:
Code: Select all
gltext_Param myGLChar;
myGLChar.x = 0.0f;
myGLChar.y = 0.0f;
myGLChar.z = 0.0f;
myGLChar.height = 1.0f;
myGLChar.width = 0.5f;
myGLChar.Red = 0.0f;
myGLChar.Green = 0.0f;
myGLChar.Blue = 0.0f;
myGLChar.endwidth = 0.1f;
myGLChar.unicodechar = 65;
DrawGLChar(&myGLChar);
Code: Select all
int i=0;
while(myText[i] != '\0')
{
myGLChar.unicodechar = myText[i];
myGLChar.x = i*(0.6f*zoom);
i++;
DrawGLChar(&myGLChar);
}
Once Display Lists are working (and I've learnt how to use them), I could imagine making a function that returns the display list merge data rather than draw the stuff right away as it does now.
If anyone is interested in having this do certain things so that they could make use of it somehow, or has other kinds of input, let me know.