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 > DS 3D capabilities?

#154519 - Interrobang - Thu Apr 17, 2008 6:23 am

I am just starting out developing on the DS.
I set up devkitPro, and compiled examples, messed with a few, and put my own model in the toon shading example.

And now, a ton of questions:

How hard is it to do deforming animated 3D characters?
Do I have to store every frame of the animation as a full list of all vertexes (like old quake format), or can I use skeletal animation?
(If not, I can do it manually, but if there is an easy way...)

How do you render a 3D view port to both screens (2 views of the same scene)?
I think it is something like rendering to an off screen buffer, putting that on the 2D screen, than rendering again for the 3d screen, but I don't really understand how to do it.
Are there any examples?


Oh, and to give you a basic idea of my skill level,

I'm bad at:
I am kind of new to C, but I'm not a complete noob. (I understand pointers...)

I'm good at:
3D math (and normal math/trig), modeling, animating, and programming in noob languages (python, action script) and a little java (enough to beat all the sample robots in robocode at once)

So...
Where do I start?

Thanks,
KaiRyu

#154581 - anomalous_underdog - Fri Apr 18, 2008 3:20 pm

A devkitARM & libnds setup uses an openGL-like library syntax (but afaik its not a full-fledged compliant OpenGL library, although its good enough for 3d games in ds), you'll want to look into opengl tutorials.

as about rendering to both screens, you got it prety much right. the word they use is render-to-texture or RTT, try searching using those keywords.

here's also another tip: use shared pointers instead of normal pointers. shared pointers automatically call delete on the object it handles. in devkitPRO, its in the std::tr1 namespace

http://www.boost.org/doc/libs/1_35_0/libs/smart_ptr/shared_ptr.htm
http://bytewave.spaces.live.com/blog/cns!19A92F96CDF7E17D!279.entry

try this:

Code:

#include <tr1/memory>

class someClass
{
public:
   void foo() {}
};

int main()
{
   std::tr1::shared_ptr<someClass> someClassInstance(new someClass());
   someClassInstance->foo(); // used like a normal pointer
   // no need to call delete
   return 0;
}

#154583 - simonjhall - Fri Apr 18, 2008 3:51 pm

Interrobang wrote:
How hard is it to do deforming animated 3D characters?
You can do this, but you've got to roll your own code for it. There are a number of threads on here that talk about skinning stuff and building display lists, or you can as you say do the old-style 'frames of animation' style approach which can look crap! This is obviously much easier to pull off ;-)

Quote:
How do you render a 3D view port to both screens (2 views of the same scene)?
You got the method basically right. What you want to do is search for 'capture' on the forums and see what you find. It's been mentioned a lot on here and many people have had a go. The DS doesn't support off-screen rendering per-se but this is the closest thing that you'll be able to get to it.

Quote:
So...
Where do I start?

I'd go through all the libnds 3D samples and the gbatek documentation to see what the hardware's capable of and what's been exposed through libnds. The DS 3D is not OpenGL-based (although it looks vaguely like it), so watch out as there are a lot of gotchas to find!
_________________
Big thanks to everyone who donated for Quake2

#154602 - Interrobang - Sat Apr 19, 2008 12:30 am

Thanks guys. That should keep me busy for awhile. But I doubt I'll finish my project without raising anymore questions, so...

"I'll be back!"