Advertising (This ad goes away for registered users. You can Login or Register)

Loading animated 3d models for PSP (IQM/IQE and .X)

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Post Reply
Mills
Posts: 31
Joined: Sat Aug 02, 2014 10:09 am

Loading animated 3d models for PSP (IQM/IQE and .X)

Post by Mills » Mon Jan 18, 2016 4:28 pm

Hi.

I wanted to help in the onelua project, and tried to load some animated models into PSP.
My knowledge of c is very limited, so I looked for some samples, and i found them.

1-LTE game engine for PSP: https://github.com/luca1897/Lte-Game-En ... master.zip
This is loading animated directX models, but there is a big problem, it was impossible for me, to isolate the loader and render functions from the rest of the engine :(.

2-Inter Quake Model and Inter Quake Export: http://sauerbraten.org/iqm/iqm-2014-11-04.tar.gz
This is a cool format with a sample to load an IQM model for PC. I could not compile it for psp because it was too complex for me. The IQE format would be easier to load, because it is a text file very similar to wavefront (.obj). I tried to copy the wavefront loader code, but it did not work.

It'd be cool if someone joins this, the goal is to read the files and convert them into a vertex array that the PSP can use like this:

Code: Select all

Vertex_ __attribute__((aligned(16))) vertex_test[3*2] =
{  //skinWeight;   u,v ;  vertex color; nx,ny,nz; x,y,z;
    {skinWeight[8],  0.999900,0.000100,  0xffffffff,  0,0,1,  1,-1,0},
    {skinWeight[8],  0.000100,0.000100,  0xffffffff,  0,0,1,  1,1,0},
    {skinWeight[8],  0.000100,0.999900,  0xffffffff,  0,0,1, -1,1,0},
    {skinWeight[8],  0.999900,0.999900,  0xffffffff,  0,0,1, -1,-1,0},
    {skinWeight[8],  0.999900,0.000100,  0xffffffff,  0,0,1,  1,-1,0},
    {skinWeight[8],  0.000100,0.999900,  0xffffffff,  0,0,1,  -1,1,0}	
};
Then we need a "sceGuBoneMatrix" that contains the bones (8 vectors with position, rotation and scale).

The easiest way to do this, would be to take the code from LTE and load .X models, because it just works great, and you can convert any model to this format, (i tested with different models inside the engine) :oops: i'll keep trying.

:D
Advertising

Post Reply

Return to “Programming and Security”