AntonioND / nitro-engine

3D engine for the Nintendo DS
150 stars 10 forks source link

Add basic 3D text support and one example #13

Closed Fewnity closed 1 year ago

Fewnity commented 1 year ago

Hey! I added a basic 3D text function with 3D position point, angles, scale. The rotation pivot is the center of the text. I created a small demo too called "3d_text" in the "other" folder.

AntonioND commented 1 year ago

So I'm a bit torn about this. The text system is pretty bad in general. It's super inflexible (you need to use snprintf if you want formatted text) and it only ends up drawing ugly text. Fixed width fonts are fine for testing, but they are terrible for anything else. It's a bit like the physics engine. It kinda works, but it's bad, and it shouldn't really be there. I should be using other libraries for this (for example, this one https://codeberg.org/drummyfish/tinyphysicsengine/src/branch/master ).

For text, ideally, I'd like something like this: https://www.coranac.com/tonc/text/tte.htm Basically, to have a few functions that can draw text to a texture, and then you can print that texture. The current text system is okay for prototype-y code, but it looks terrible if you're trying to actually have nice graphics for your game.

The main problem with all this stuff (text, physics) is that they aren't simple things, and I didn't know that when I started developing it in 2008. At the moment, I'm trying to reduce the scope of what Nitro Engine can do.

For example, check the message of this commit https://github.com/AntonioND/nitro-engine/commit/8aa6b382d2ea090e6fa667478561a4c082367ee3 . I used to support arbitrary width textures, but that's a bad idea. If you want smaller files, you can compress them. My width expansion code was slow and pointless.

AntonioND commented 1 year ago

The kind of things I really want to support are things that are very tied to the GPU hardware, like animated models, compressed textures, etc, which is what I've been focused on.

AntonioND commented 1 year ago

Yeah, I think this is better left as part of the application. I don't want to add even more functionality to the text system, not unless it is modified quite a bit to make it good.