HomeForumsWhat's newResources 
 
 
Structured 3D
Zaksund - Apr 17, 2006
 Zaksund Apr 17, 2006
Hey guys, I've been working on a small project and have been wondering something. Okay, you know how 3D models are animated using nested matrices right? Well instead of hard-coding the structure of the matrices, is there some way data like this could be loaded from CD?

No rush or anything, the code still works fine with the way it is, but there's gotta be a better way than having something like...

Code:
  
void handle_character_skeletal_structure()

{

 switch(selected_character) //where 'selected_character' is a global.

 {

 case 0:

  slPushMatrix();

  {

  e2_SPRITE3D_animate(0);

  slPushMatrix();

  {

   e2_SPRITE3D_animate(1);

   slPushMatrix();

   {

   e2_SPRITE3D_animate(2);

   }

   slPopMatrix();

  }

  slPopMatrix();

  }

  slPopMatrix();

  break;

 case 1:

  ...

  break;

 }

 return;

}
in your source everytime, eh? I remember there being some sort of 'object' structure that pointed to 'limbs' (child matrices) of a model, but since I'm at work I don't have the docs right in front of me. (god forbid I'd actually be working, heh :lol: )

Once again, this is more of a curiosity than a crisis.

Like always, any info is appreciated

 RockinB Apr 24, 2006
Sorry for the late answer...


  
	
	
Originally posted by Zaksund+Mon, 2006-04-17 @ 06:23 PM-->
QUOTE(Zaksund @ Mon, 2006-04-17 @ 06:23 PM)
Okay, you know how 3D models are animated using nested matrices right? Well instead of hard-coding the structure of the matrices, is there some way data like this could be loaded from CD?

[post=145747]Quoted post[/post]

[/b]



Of course there is. You could create binary files on PC and load it on Saturn. You would have to define the binary format by yourself(serialize the OBJECT tree to an array of OBJECTs, child pointers are converted to indices in that array, Saturn converts them back to pointers after reading), there is no ready-to-use solution.

This has to be linked to actual 3D data, too. I did something similar that works on Saturn 3D SGL C code which reads C code and produces binary files and C code as well. Look for files RB_POL* and RB_MAP inside the RB library....