Skip to main content
gamedev.net
🔒 Locked

Loading MD3

Started by Ademan555 4 replies 600+ views
Original Post
Ademan555
Ademan555
Ok, so after asking around here on gamedev ive settled on using the md3 format for now... and after plenty of googleing... ive found something out... i can hardly find any tuts on loading the md3, the one that i DID have.. seemed to have bad information, because all of the tags that are supposedly in MD3 files... werent there... (U8, VEC3) all that... does anyone know of any loading tutorials? or just doccuments on the md3 filetype? thanx -Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi
Null and Void
Null and Void
Although it seems likely that it''s the same one you claim "seemed to have bad information" from your post''s contents, I successfully wrote a MD3 loader based on the information in this file format description a couple weeks ago.

CGameProgrammer
CGameProgrammer
You probably just didn''t understand the file format. You aren''t going to actually find the words "VEC3" in the md3 file, you know.

~CGameProgrammer( );

Screenshots of your games or desktop captures -- Upload up to four 1600x1200 screenshots of your projects, registration optional. View all existing ones in the archives..
~CGameProgrammer( ); Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
Ademan555
Ademan555
i didnt.... i thought they were flags that would say to my loader (or anyone elses) "here comes a vector" if not... then im confused... lol well ima look at it again... it may make more sense than i think...
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi
eFoDay
eFoDay
check out gametutorials.com

http://www.gametutorials.com/download/OpenGL/MD3Loader_OGL.zip

http://www.gametutorials.com/download/OpenGL/MD3Animation_OGL.zip
CGameProgrammer
CGameProgrammer
No, they''re not flags. I''ll explain... let''s look at the first three data items in the MD3 file:
quote:
Null and Void''s link:
S32 IDENT Magic number. As a string of 4 octets, reads "IDP3", as unsigned little-endian 1367369843 (0x51806873), as unsigned big-endian 1936228433 (0x73688051).
S32 VERSION MD3 version number, latest known is 15, but use the constant MD3_VERSION
U8 * MAX_QPATH NAME MD3 name, usually its pathname in the PK3. ASCII character string, NUL-terminated (C-style). Current value of MAX_QPATH is 64.

Translation:
The first four bytes (32-bit signed integer, or "S32" as the website calls it) are used to indicate the file is an MD3 file -- the bytes appear as ''I'', ''D'', ''P'', and ''3''.

Next comes a signed 32-bit integer that indicates the version number.

Next is an array of unsigned bytes ("U8" meaning 8-bit unsigned) that indicate the name of the MD3. The size of the array is 64 (MAX_QPATH would be defined only in an official id Software header file, so you have to just know it''s 64 it if you''re coding from scratch). Because the website says the string is null-terminated, but it''s U8 * MAX_QPATH characters long, that means the string is followed by a bunch of 0s until MAX_QPATH is reached. If MAX_QPATH was 16, then the string would look like this:

"Player.md3······"

where "·" represents the null character ("\0").

~CGameProgrammer( );

Screenshots of your games or desktop captures -- Upload up to four 1600x1200 screenshots of your projects, registration optional. View all existing ones in the archives..
~CGameProgrammer( ); Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.