| View previous topic :: View next topic |
| Author |
Message |
Rangu2057
Joined: 23 Jul 2007 Posts: 87 Location: wilmington, NC
|
Posted: Sat Jul 19, 2008 3:35 pm Post subject: MD2Lib troubles |
|
|
im trying to code a MD2Library for the psp using this page here http://en.wikipedia.org/wiki/MD2_%28file_format%29
and here is my code so far
EDIT: i already know i havent added the other headers
| Code: |
#include "stdio.h"
#ifdef __cplusplus__
extern "C" {
#endif /* __cplusplus */
typedef struct MD2_Header{
int ident;
int version
int skinwidth;
int skinheight;
int framesize;
int num_skins;
int num_xyz;
int num_st;
int num_tris;
int num_glcmds;
int num_frames;
int ofs_skins;
int ofs_st;
int ofs_tris;
int ofs_frames;
int ofs_glcmds;
int ofs_end;
}MD2_Header;
/* at offset ofs_st its num_st * this struct */
typedef struct MD2_ofs1{
short s;
short t;
}MD2_ofs1
/*
typedef struct MD2_
int Load_MD2(char *target){
MD2_Header *header;
if(Load_MD2(char *target)
{
printf("file %d loaded sucessfully!\n\n", char *target);
printf("verifying struct...\n");
printf("%d"
}
/* this function decompresses a single frame and displays it
*
*/
int Decompress_Frame(int frame)
{
}
int MD2GetMagic(void)
{
return ident;
}
int MD2GetVersion(void)
{
return version;
}
int MD2GetSkinWidth(void)
{
return skinwidth;
}
int MD2GetSkinHeight(void)
{
return skinheight;
}
int MD2GetFrameSize(void)
{
return framesize;
}
int MD2GetNumSkins(void)
{
return num_skins;
}
int MD2GetNumXYZ(void)
{
return num_xyz
}
int MD2GetNumST(void)
{
return num_st;
}
int MD2GetNumTri(void)
{
return num_tris;
}
int MD2GetNumGL(void)
{
return num_glcmds;
}
int MD2GetNumFrames(void)
{
return num_frames;
}
int MD2GetSkinOffs(void)
{
return ofs_skins;
if(ofs_skins << unsigned char[64])
{
printf("error at %d", ofs_skins);
}
else if(ofs_skins == unsigned char[64])
{
printf("%d", ofs_skins);
}
return ofs_skins;
}
int MD2GetSTOffs(void)
{
ofs_st = (num_st * (MD2_ofs1 *header));
return ofs_st;
}
int MD2GetTrigOffs(void)
{
return ofs_tris;
}
int MD2GetFrameOffs(void)
{
return ofs_frames;
}
int MD2GetGLOffs(void)
{
return ofs_glcmds;
}
int MD2GetEndOffs(void)
{
return ofs_end;
}
|
im still only a noob right now when it comes to 3D graphics, but i decided to give it a try and now im so freaking confused now and asking some advice if im doing something right or wrong... _________________ the questions of today are awnswered by the blood and bullets of tomorrow! ---EagleEye--- (Socom FTB2) |
|
| Back to top |
|
 |
Smong
Joined: 04 Sep 2007 Posts: 82
|
Posted: Sat Jul 19, 2008 9:20 pm Post subject: Re: MD2Lib troubles |
|
|
You didn't say where you were going wrong. This also doesn't look like a PSP specific question.
I noticed this part has strange commenting:
| Rangu2057 wrote: | | Code: | /*
typedef struct MD2_
int Load_MD2(char *target){
MD2_Header *header;
if(Load_MD2(char *target)
{
printf("file %d loaded sucessfully!\n\n", char *target);
printf("verifying struct...\n");
printf("%d"
}
/* this function decompresses a single frame and displays it
*
*/
int Decompress_Frame(int frame)
{
} |
|
There is a MD2 in Open GL sample at Cone3D:
http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/ogladv/tut2
You'll need to remove the PCX loader and convert the glVertex/glNormal to instead generate a list of vertices that can be passed to sceGumDrawArray.
pspdev\psp\sdk\samples\gu\common\geometry.h has a bunch of structs you may find useful for storing the vertices in on PSP. _________________ (+[__]%) |
|
| Back to top |
|
 |
Rangu2057
Joined: 23 Jul 2007 Posts: 87 Location: wilmington, NC
|
Posted: Sun Jul 20, 2008 12:01 am Post subject: |
|
|
ok, thanks for the help :) _________________ the questions of today are awnswered by the blood and bullets of tomorrow! ---EagleEye--- (Socom FTB2) |
|
| Back to top |
|
 |
|