gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > 3D Development Questions

#98942 - HalifaxNic - Fri Aug 18, 2006 4:56 pm

I just recently heard about the ability to run your own programs on the nintendo ds and thought it would be interesting to try it since I also recently purchased a DS. I have written a windows program that displays 3d finite element models of ships and would like to try and port the code to the DS if possible. The program uses some openGL calls and I'm not sure if there is an openGL port for the DS or if I would have to write all my own calls. Also the software uses some fortran code that reads the finite element models. Does anyone know if it is possible to compile fortran into a library that will run on the DS? I already have the C wrappers for calling the fortran. Does this sound like too much work for my first project or is it doable with a reasonable amount of effort? Thanks for any advice you can provide.

#98956 - xexamedes - Fri Aug 18, 2006 6:40 pm

The Ds has a subset of openGL. The easiest way to get started on this is to go to PALib (Which has a lot of handy wrappers to shorten you code, esp. for 3D/OpenGl stuff.

http://www.palib.com

Go to the wiki, and then to "installation". The first step is to install devkitPro, and then PALib over that. When you've done that you will have a lot of examples, many in 3d, with makefiles and for some stuff bat-files.

remember to use the Ideas emulator, since it's the only one capable of 3d.

Cheers,
PS

#99007 - Sausage Boy - Sat Aug 19, 2006 1:14 am

I suggest you learn libnds instead of PALib. Libnds is mostly a set of defines for register addresses, which means you have exact control of what to do to make the hardware do different things. That will give you a deeper knowledge of how the platform actually works, what cool stuff you can do and what you can't do, and how to best do things.

PALib might be suitable for beginners who really don't care about HOW the program works, just THAT it works. I suppose it's up to you to decide what kind of person you are. I seem to recall a quate that went something like "the difference between a professional programmer and a mediocre one is how well they understand the hardware", and I think it's true.

Quote:
remember to use the Ideas emulator, since it's the only one capable of 3d.


This statement is even outright false. It's a lie. It's not true. In fact, Dualis has quite nice 3d support. No$gba (don't let the name fool you, it emulates the DS as well) has some problem with texture loading in homebrew I think, but other than that it's extremely good. Another good thing about Dualis is that it emulates a GBAMP so you can use it with the fatlib, which almost every homebrew program uses.
_________________
"no offense, but this is the gayest game ever"

#99044 - dovoto - Sat Aug 19, 2006 6:09 am

wow..PALib for 3D. libnds has an opengl implementation (not complete and not quite standard but not bad either). Why PALib decided to wrap that with its own calls i have no idea but i recomend that even if you are using PALib (nothing wrong with that per se) you avoid the PALib wrappers and call the libnds gl code directly (PALib still runs on a version of libnds last i looked so it should be a matter of including the videoGL.h header).

You can find a wealth of opengl information out there including many well written tutorials. If you are just learning 3D the ds is not a bad place to start.

I recomend the Nehe tutorials as I took the time to convert the first 10 or so lessons over to ds compatible gl code (I dont know if PALib distro includes the full set of libnds examples so i recomend you grab them from http://www.devkitpro.org )

http://nehe.gamedev.net
_________________
www.drunkencoders.com

#99109 - HalifaxNic - Sat Aug 19, 2006 4:16 pm

Thanks for all the useful information guys. Does anyone know if it is possible to compile fortran to run on the DS or if I would have to port the calls to C/C++?

#99120 - Sausage Boy - Sat Aug 19, 2006 4:51 pm

I think using C/C++ will be alot easier than getting fortran to work :P
_________________
"no offense, but this is the gayest game ever"