Zalo DS Blog

Wednesday, May 09, 2007

Starting with 3d!!

Yeah, that was something I wanted to do from the first day... how does 3d work in my DS? is it easy, hard... how far has libnds go with it... haha I have been investigating it during the last weeks. I am still on it, but now I got somethig ^_^

Well, when I started to read doccuments about all this stuff I realized that all this things were very familiar... they were like opengl... they were openGL!!. With a few differences. And then, after a box was painted on my screen I wanted more :D (if you want a box to be painted on your screen, just run one of the libnds examples)

Then I remembered that the last year I was doing something very similar to this... but with my other pocket console, the N-gage. Then I started to think... do I have to do everything I did again? All that stuff was done in Symbian and using openglES wich s very similar to openGl but not exactly the same. It was a pitty!! I had my exporter and a bunch of lines of code displaying animations, cameras...

And then I started to recode all that stuff to be a multiplatform 3d engine extracting everything that was only realated to Symbian and not C++ to a separated files that will have to be coded again for every new platform I wanted to port :D

Once it worked in Symbian I started DS port. Ds is wonderfull, but has some things really annoying. The first is that vertex has to be 4.12 fixed point... that mean that if a vertex goes beyond [-8.0f, 7.0f] there is going to be problems... XDDDD

I could fix this scaling the matrices... but then I had problems with the normals because DS doesn't have something like GL_NORMALIZE (basically what it does is auto-normalize your normals with is very useful when you have scalated matrix)

Well, maybe other day, when I know that someone is reading all this, I will write about all it. But now here is the first demo for DS and Symbian (series 60) of my multiplatform 3d engine!

By the way... do you know what is really good having a mulplatform whatever?... you cannot debug in NDS at all... but you can in Symbian!! ^_^ This is really something wonderfull!!!!

I will post again, when I am bored :P . Still need to fix some problems with big meshes. Here you have the files, if you want them. Source code? Of course... ask for it, like always ;)