import java.io.*;

class Md2Triangle
{
	short   index_xyz[] = new short[3];    // indexes to triangle's vertices
}

class Md2Frame
{
	float       scale[] = new float[3];       // scale values
	float       translate[] = new float[3];   // translation vector
}

class Md2Vertex
{
	short	v[] = new short[3];                // compressed vertex (x, y, z) coordinates
}

class Head
{
	// Equivalent to header and easy for reading
	int data[] = new int[17];
}

class Md2FileFormat
{
	int     ident;              // magic number. must be equal to "IPD2"
	int     version;            // md2 version. must be equal to 8

	int     skinwidth;          // width of the texture
	int     skinheight;         // height of the texture
	int     framesize;          // size of one frame in bytes

	int     num_skins;          // number of textures
	int     num_xyz;            // number of vertices
	int     num_st;             // number of texture coordinates
	int     num_tris;           // number of triangles
	int     num_glcmds;         // number of opengl commands
	int     num_frames;         // total number of frames

	int     ofs_skins;          // offset to skin names (64 bytes each)
	int     ofs_st;             // offset to s-t texture coordinates
	int     ofs_tris;           // offset to triangles
	int     ofs_frames;         // offset to frame data
	int     ofs_glcmds;         // offset to opengl commands
	int     ofs_end;            // offset to end of file
    
	public void readFromHead(Head head) {
		ident 	= head.data[0];
		version = head.data[1];
				
		skinwidth = head.data[2];
		skinheight = head.data[3];
		framesize = head.data[4];
		
		num_skins = head.data[5];
		num_xyz = head.data[6];
		num_st = head.data[7];
		num_tris = head.data[8];
		num_glcmds = head.data[9];
		num_frames = head.data[10];
		
		ofs_skins = head.data[11];
		ofs_st = head.data[12];
		ofs_tris = head.data[13];
		ofs_frames = head.data[14];
		ofs_glcmds = head.data[15];
		ofs_end = head.data[16];
    }
    
	public void print() {
		System.out.println(""+
		ident + " " +
		version + " " +
		
		skinwidth +  " " +
		skinheight  + " " +
		framesize  + " " +
				 
		num_skins  + " " + 
		num_xyz   + " " +
		num_st   + " " +
		num_tris   + " " +
		num_glcmds   + " " +
		num_frames   + " " +
		
		ofs_skins   + " " +
		ofs_st   + " " +
		ofs_tris   + " " +
		ofs_frames   + " " +
		ofs_glcmds   + " " +
		ofs_end   + " " );
	}
}
