Hi guys,
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 which I want to be able to use on my PSP using PSPGL.
I'm baking my own font here, using the minimum amount of triangles possible (max five so far). Looks a bit Asian as a result.
Although I don't fully understand how everything works just yet (in terms of setting up the renderer and such), I got the basics working thanks to Nehe's Lesson 6, and what I set out to do is already up and running.
Firstly, 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 (right now I only have capital letters, no numbers yet).
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:
And you can write text for it using this:
Here's an .elf sample (load with FileAssistant++). I'll post source as soon as I made it a proper library and add 0-9 and dots 'n stuff.
Once Display Lists are working (they don't just yet on the PSP version of GL) 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.
Especially in this forum, I would really appreciate hearing on some nice effects ideas. Initially I'm looking at really basic stuff, as I'm still learning (this is my second C project after p-sprint, also on the PSP). At the very least I'd like to get this as a basis for some text-based games.
Also, I would like to learn more about best practices, as I'm sure many people here have tips on that.
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 which I want to be able to use on my PSP using PSPGL.
I'm baking my own font here, using the minimum amount of triangles possible (max five so far). Looks a bit Asian as a result.
Although I don't fully understand how everything works just yet (in terms of setting up the renderer and such), I got the basics working thanks to Nehe's Lesson 6, and what I set out to do is already up and running.
Firstly, 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 (right now I only have capital letters, no numbers yet).
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:
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);
And you can write text for it using this:
Code:
int i=0;
while(myText[i] != '\0')
{
myGLChar.unicodechar = myText[i];
myGLChar.x = i*(0.6f);
i++;
DrawGLChar(&myGLChar);
}
Here's an .elf sample (load with FileAssistant++). I'll post source as soon as I made it a proper library and add 0-9 and dots 'n stuff.
Once Display Lists are working (they don't just yet on the PSP version of GL) 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.
Especially in this forum, I would really appreciate hearing on some nice effects ideas. Initially I'm looking at really basic stuff, as I'm still learning (this is my second C project after p-sprint, also on the PSP). At the very least I'd like to get this as a basis for some text-based games.
Also, I would like to learn more about best practices, as I'm sure many people here have tips on that.
Last edited by a moderator: