Browse Source
Added support for stripped MDL model.
Added support for stripped MDL model.
Models are rendered without any 3D transformations but with a bit of faked lighting and animations. Added converted player model file and converted normals lookup table.master
6 changed files with 307 additions and 7 deletions
-
1CMakeLists.txt
-
104main.c
-
BINplayer.ps1mdl
-
162ps1anorms.h
-
47ps1mdl.h
-
BINshambler128.tim
@ -0,0 +1,162 @@ |
|||
{-2153, 0, 3484}, |
|||
{-1813, 978, 3539}, |
|||
{-1209, 0, 3913}, |
|||
{-1265, 2048, 3313}, |
|||
{-665, 1076, 3895}, |
|||
{0, 0, 4096}, |
|||
{0, 3484, 2153}, |
|||
{-604, 2935, 2792}, |
|||
{604, 2935, 2792}, |
|||
{0, 2153, 3484}, |
|||
{1265, 2048, 3313}, |
|||
{2153, 0, 3484}, |
|||
{1209, 0, 3913}, |
|||
{1813, 978, 3539}, |
|||
{665, 1076, 3895}, |
|||
{-2792, 604, 2935}, |
|||
{-3313, 1265, 2048}, |
|||
{-2407, 1742, 2818}, |
|||
{-3484, 2153, 0}, |
|||
{-3539, 1813, 978}, |
|||
{-2935, 2792, 604}, |
|||
{-2818, 2407, 1742}, |
|||
{-2048, 3313, 1265}, |
|||
{-978, 3539, 1813}, |
|||
{-1742, 2818, 2407}, |
|||
{-2935, 2792, -604}, |
|||
{-2048, 3313, -1265}, |
|||
{-2153, 3484, 0}, |
|||
{0, 3484, -2153}, |
|||
{-978, 3539, -1813}, |
|||
{0, 3913, -1209}, |
|||
{-1076, 3895, -665}, |
|||
{0, 4096, 0}, |
|||
{0, 3913, 1209}, |
|||
{-1076, 3895, 665}, |
|||
{978, 3539, 1813}, |
|||
{1076, 3895, 665}, |
|||
{2048, 3313, 1265}, |
|||
{978, 3539, -1813}, |
|||
{1076, 3895, -665}, |
|||
{2048, 3313, -1265}, |
|||
{3484, 2153, 0}, |
|||
{2935, 2792, 604}, |
|||
{2935, 2792, -604}, |
|||
{2153, 3484, 0}, |
|||
{1742, 2818, 2407}, |
|||
{3539, 1813, 978}, |
|||
{2818, 2407, 1742}, |
|||
{3313, 1265, 2048}, |
|||
{2792, 604, 2935}, |
|||
{2407, 1742, 2818}, |
|||
{3913, 1209, 0}, |
|||
{4096, 0, 0}, |
|||
{3895, 665, 1076}, |
|||
{3484, -2153, 0}, |
|||
{3913, -1209, 0}, |
|||
{3539, -1813, 978}, |
|||
{3895, -665, 1076}, |
|||
{3313, -1265, 2048}, |
|||
{2792, -604, 2935}, |
|||
{3484, 0, 2153}, |
|||
{3539, 1813, -978}, |
|||
{3313, 1265, -2048}, |
|||
{3895, 665, -1076}, |
|||
{2153, 0, -3484}, |
|||
{2792, 604, -2935}, |
|||
{2792, -604, -2935}, |
|||
{3484, 0, -2153}, |
|||
{3313, -1265, -2048}, |
|||
{3539, -1813, -978}, |
|||
{3895, -665, -1076}, |
|||
{604, 2935, -2792}, |
|||
{1265, 2048, -3313}, |
|||
{1742, 2818, -2407}, |
|||
{1813, 978, -3539}, |
|||
{2407, 1742, -2818}, |
|||
{2818, 2407, -1742}, |
|||
{-604, 2935, -2792}, |
|||
{-1265, 2048, -3313}, |
|||
{0, 2153, -3484}, |
|||
{-2153, 0, -3484}, |
|||
{-1813, 978, -3539}, |
|||
{-1209, 0, -3913}, |
|||
{-665, 1076, -3895}, |
|||
{0, 0, -4096}, |
|||
{1209, 0, -3913}, |
|||
{665, 1076, -3895}, |
|||
{-1813, -978, -3539}, |
|||
{-1265, -2048, -3313}, |
|||
{-665, -1076, -3895}, |
|||
{0, -3484, -2153}, |
|||
{-604, -2935, -2792}, |
|||
{604, -2935, -2792}, |
|||
{0, -2153, -3484}, |
|||
{1265, -2048, -3313}, |
|||
{1813, -978, -3539}, |
|||
{665, -1076, -3895}, |
|||
{978, -3539, -1813}, |
|||
{2048, -3313, -1265}, |
|||
{1742, -2818, -2407}, |
|||
{2935, -2792, -604}, |
|||
{2818, -2407, -1742}, |
|||
{2407, -1742, -2818}, |
|||
{0, -3913, -1209}, |
|||
{0, -4096, 0}, |
|||
{1076, -3895, -665}, |
|||
{0, -3484, 2153}, |
|||
{0, -3913, 1209}, |
|||
{978, -3539, 1813}, |
|||
{1076, -3895, 665}, |
|||
{2048, -3313, 1265}, |
|||
{2935, -2792, 604}, |
|||
{2153, -3484, 0}, |
|||
{-978, -3539, -1813}, |
|||
{-2048, -3313, -1265}, |
|||
{-1076, -3895, -665}, |
|||
{-3484, -2153, 0}, |
|||
{-2935, -2792, -604}, |
|||
{-2935, -2792, 604}, |
|||
{-2153, -3484, 0}, |
|||
{-2048, -3313, 1265}, |
|||
{-978, -3539, 1813}, |
|||
{-1076, -3895, 665}, |
|||
{-3539, -1813, 978}, |
|||
{-3313, -1265, 2048}, |
|||
{-2818, -2407, 1742}, |
|||
{-2792, -604, 2935}, |
|||
{-1813, -978, 3539}, |
|||
{-2407, -1742, 2818}, |
|||
{-1265, -2048, 3313}, |
|||
{-604, -2935, 2792}, |
|||
{-1742, -2818, 2407}, |
|||
{-665, -1076, 3895}, |
|||
{1813, -978, 3539}, |
|||
{665, -1076, 3895}, |
|||
{1265, -2048, 3313}, |
|||
{604, -2935, 2792}, |
|||
{0, -2153, 3484}, |
|||
{1742, -2818, 2407}, |
|||
{2407, -1742, 2818}, |
|||
{2818, -2407, 1742}, |
|||
{-3913, 1209, 0}, |
|||
{-3895, 665, 1076}, |
|||
{-4096, 0, 0}, |
|||
{-3484, 0, 2153}, |
|||
{-3913, -1209, 0}, |
|||
{-3895, -665, 1076}, |
|||
{-3539, 1813, -978}, |
|||
{-3895, 665, -1076}, |
|||
{-3313, 1265, -2048}, |
|||
{-3539, -1813, -978}, |
|||
{-3895, -665, -1076}, |
|||
{-3313, -1265, -2048}, |
|||
{-2792, 604, -2935}, |
|||
{-2792, -604, -2935}, |
|||
{-3484, 0, -2153}, |
|||
{-2818, 2407, -1742}, |
|||
{-2407, 1742, -2818}, |
|||
{-1742, 2818, -2407}, |
|||
{-1742, -2818, -2407}, |
|||
{-2407, -1742, -2818}, |
|||
{-2818, -2407, -1742}, |
|||
@ -0,0 +1,47 @@ |
|||
#ifndef __PS1MDL_H__ |
|||
#define __PS1MDL_H__ |
|||
|
|||
#ifdef __cplusplus |
|||
extern "C" { |
|||
#endif |
|||
|
|||
typedef struct |
|||
{ |
|||
int ident; |
|||
int version; |
|||
|
|||
unsigned short vertexCount; |
|||
unsigned short triangleCount; |
|||
unsigned short frameCount; |
|||
} ps1mdl_header_t; |
|||
|
|||
typedef struct |
|||
{ |
|||
char onSeam; |
|||
short u, v; |
|||
} ps1mdl_texcoord_t; |
|||
|
|||
typedef struct |
|||
{ |
|||
unsigned short vertexIndex[3]; |
|||
} ps1mdl_triangle_t; |
|||
|
|||
typedef struct |
|||
{ |
|||
unsigned char position[3]; |
|||
unsigned char normalIndex; |
|||
} ps1mdl_vertex_t; |
|||
|
|||
typedef struct |
|||
{ |
|||
ps1mdl_header_t *header; |
|||
ps1mdl_texcoord_t *texCoords; |
|||
ps1mdl_triangle_t *triangles; |
|||
ps1mdl_vertex_t *vertices; |
|||
} ps1mdl_t; |
|||
|
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
|
|||
#endif // __PS1BSP_H__ |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue