Code-R@Posted: Wed Aug 16, 2006 1:03 pm    Post subject: Simple MD5 cube?: I was wondering if someone could provide a simple MD5MESH model of a cube, centered around the origin preferably (extending from -0.5 to 0.5 on each axis), as I was writing an MD5 loader, and it's been hel trying to debug complex models. I apologize for this, but I don't have/know how to use a modeling package, I'm first and foremost a programmer. TIA.


Rayne@Posted: Thu Aug 17, 2006 12:24 am    Post subject: : Try this: in this md5 code you have

- a cube that is 64 x 64 units big in the engine, with default grid spacing
- two joints, one named "root" and the other something like "joint#"
- a small cube named "origin"

(for any kind of questions contact me at mark dot rayne at gmail dot com )


Code:

MD5Version 10
commandline "mesh models/code/code.ma -dest models/code/code.md5mesh -game blackrose -game sw"

numJoints 3
numMeshes 1

joints {
   "origin"   -1 ( 0 0 0 ) ( 0 0 0 )      //
   "root"   0 ( 0 0 0 ) ( -0.5001951456 0.4998047054 -0.4998047054 )      // origin
   "joint1"   1 ( 0.0249728262 0.0000019062 31.9803333282 ) ( -0.7071067691 0.0000000527 0.0000000105 )      // root
}

mesh {
   // meshes: Mesh
   shader ""

   numverts 24
   vert 0 ( 0.1875 -0.25 ) 0 2
   vert 1 ( -0.3125 -0.25 ) 2 2
   vert 2 ( -0.3125 0.25 ) 4 2
   vert 3 ( 0.1875 0.25 ) 6 2
   vert 4 ( 0.1875 -0.25 ) 8 2
   vert 5 ( -0.3125 -0.25 ) 10 2
   vert 6 ( -0.3125 0.25 ) 12 2
   vert 7 ( 0.1875 0.25 ) 14 2
   vert 8 ( -0.25 -0.5 ) 10 2
   vert 9 ( -0.25 0 ) 4 2
   vert 10 ( 0.25 0 ) 2 2
   vert 11 ( 0.25 -0.5 ) 12 2
   vert 12 ( -0.3125 -0.5 ) 12 2
   vert 13 ( -0.3125 0 ) 2 2
   vert 14 ( 0.1875 0 ) 0 2
   vert 15 ( 0.1875 -0.5 ) 14 2
   vert 16 ( -0.25 -0.5 ) 14 2
   vert 17 ( -0.25 0 ) 0 2
   vert 18 ( 0.25 0 ) 6 2
   vert 19 ( 0.25 -0.5 ) 8 2
   vert 20 ( -0.1875 -0.5 ) 8 2
   vert 21 ( -0.1875 0 ) 6 2
   vert 22 ( 0.3125 0 ) 4 2
   vert 23 ( 0.3125 -0.5 ) 10 2

   numtris 12
   tri 0 2 1 0
   tri 1 2 0 3
   tri 2 6 5 4
   tri 3 6 4 7
   tri 4 10 9 8
   tri 5 10 8 11
   tri 6 14 13 12
   tri 7 14 12 15
   tri 8 18 17 16
   tri 9 18 16 19
   tri 10 22 21 20
   tri 11 22 20 23

   numweights 16
   weight 0 1 0.7386021614 ( -31.9750022888 -32.0249786377 -32 )
   weight 1 2 0.2613978386 ( 31.9750270844 -63.9803352356 -32 )
   weight 2 1 0.7386021614 ( -31.9750022888 -32.0249786377 32 )
   weight 3 2 0.2613978386 ( 31.9750270844 -63.9803352356 32 )
   weight 4 1 0.7387529016 ( -32.0249786377 31.9750022888 32 )
   weight 5 2 0.2612471282 ( -32.0249710083 -63.9803352356 32 )
   weight 6 1 0.7387529016 ( -32.0249786377 31.9750022888 -32 )
   weight 7 2 0.2612471282 ( -32.0249710083 -63.9803352356 -32 )
   weight 8 1 0.5 ( 31.9750022888 32.0249786377 -32 )
   weight 9 2 0.5 ( -32.0249710083 0.0196647644 -32 )
   weight 10 1 0.5 ( 31.9750022888 32.0249786377 32 )
   weight 11 2 0.5 ( -32.0249710083 0.0196647644 32 )
   weight 12 1 0.5 ( 32.0249786377 -31.9750022888 32 )
   weight 13 2 0.5 ( 31.9750270844 0.0196647644 32 )
   weight 14 1 0.5 ( 32.0249786377 -31.9750022888 -32 )
   weight 15 2 0.5 ( 31.9750270844 0.0196647644 -32 )
}

_________________
theRev is coming...



iceheart@Posted: Thu Aug 17, 2006 12:41 am    Post subject: : Why is a cube 24 verts?
_________________
Staff
www.modwiki.net - wiki resource for all Doom 3 engine-based games.



rich_is_bored@Posted: Thu Aug 17, 2006 5:22 am    Post subject: : Ooh it's like a riddle...

Each side is unwelded.
_________________
Staff
Learn something today? Why not write an article about it on modwiki.net?



Rayne@Posted: Fri Aug 18, 2006 8:53 pm    Post subject: : Oh, eheh Rich is right... exported the cube from Radiant and all the faces are separated... Very Happy
_________________
theRev is coming...



Code-R@Posted: Thu Aug 24, 2006 7:27 am    Post subject: : Thanks a million!


kat@Posted: Thu Aug 24, 2006 7:52 am    Post subject: :
Rayne wrote:
Oh, eheh Rich is right... exported the cube from Radiant and all the faces are separated... Very Happy
At least that means you won't get fuglied smoothing on the mesh!
_________________
Co-Admin - Modelling and modding tutorials and tips



Rayne@Posted: Thu Aug 24, 2006 10:50 am    Post subject: : Now that's strange... I've opened the .ma file again and the cube's vertices are perfectly welded... So probably I'll make another test to see how this works.

Strange thing...
_________________
theRev is coming...



Code-R@Posted: Thu Aug 24, 2006 4:32 pm    Post subject: : mind posting the welded version's md5mesh?


der_ton@Posted: Fri Aug 25, 2006 1:32 pm    Post subject: :
Rayne wrote:
Now that's strange... I've opened the .ma file again and the cube's vertices are perfectly welded...

If the vertices need to be separate or not depends on the format. In md5mesh, they need to be separate to signal that they don't share normal vectors. In other formats, there are other ways to represent that information.
_________________
Staff
Modelviewer | 3DSMax<->MD5 | Blender<->MD5



Code-R@Posted: Sat Aug 26, 2006 7:26 pm    Post subject: : I understand that means you can't represent a cube with 8 vertices, but do you need an entire 24 under MD5?


der_ton@Posted: Sun Aug 27, 2006 3:31 pm    Post subject: : Yes, because each of the 8 vertices has 3 different normals, depending on which of the 3 adjacent faces it is part of.
8 x 3 = 24
_________________
Staff
Modelviewer | 3DSMax<->MD5 | Blender<->MD5



Rayne@Posted: Mon Aug 28, 2006 11:25 am    Post subject: : Yeah, I've checked the scene file again and the cube IT'S all welded
_________________
theRev is coming...



Code-R@Posted: Wed Aug 16, 2006 1:03 pm    Post subject: Simple MD5 cube?: I was wondering if someone could provide a simple MD5MESH model of a cube, centered around the origin preferably (extending from -0.5 to 0.5 on each axis), as I was writing an MD5 loader, and it's been hel trying to debug complex models. I apologize for this, but I don't have/know how to use a modeling package, I'm first and foremost a programmer. TIA.


Rayne@Posted: Thu Aug 17, 2006 12:24 am    Post subject: : Try this: in this md5 code you have

- a cube that is 64 x 64 units big in the engine, with default grid spacing
- two joints, one named "root" and the other something like "joint#"
- a small cube named "origin"

(for any kind of questions contact me at mark dot rayne at gmail dot com )


Code:

MD5Version 10
commandline "mesh models/code/code.ma -dest models/code/code.md5mesh -game blackrose -game sw"

numJoints 3
numMeshes 1

joints {
   "origin"   -1 ( 0 0 0 ) ( 0 0 0 )      //
   "root"   0 ( 0 0 0 ) ( -0.5001951456 0.4998047054 -0.4998047054 )      // origin
   "joint1"   1 ( 0.0249728262 0.0000019062 31.9803333282 ) ( -0.7071067691 0.0000000527 0.0000000105 )      // root
}

mesh {
   // meshes: Mesh
   shader ""

   numverts 24
   vert 0 ( 0.1875 -0.25 ) 0 2
   vert 1 ( -0.3125 -0.25 ) 2 2
   vert 2 ( -0.3125 0.25 ) 4 2
   vert 3 ( 0.1875 0.25 ) 6 2
   vert 4 ( 0.1875 -0.25 ) 8 2
   vert 5 ( -0.3125 -0.25 ) 10 2
   vert 6 ( -0.3125 0.25 ) 12 2
   vert 7 ( 0.1875 0.25 ) 14 2
   vert 8 ( -0.25 -0.5 ) 10 2
   vert 9 ( -0.25 0 ) 4 2
   vert 10 ( 0.25 0 ) 2 2
   vert 11 ( 0.25 -0.5 ) 12 2
   vert 12 ( -0.3125 -0.5 ) 12 2
   vert 13 ( -0.3125 0 ) 2 2
   vert 14 ( 0.1875 0 ) 0 2
   vert 15 ( 0.1875 -0.5 ) 14 2
   vert 16 ( -0.25 -0.5 ) 14 2
   vert 17 ( -0.25 0 ) 0 2
   vert 18 ( 0.25 0 ) 6 2
   vert 19 ( 0.25 -0.5 ) 8 2
   vert 20 ( -0.1875 -0.5 ) 8 2
   vert 21 ( -0.1875 0 ) 6 2
   vert 22 ( 0.3125 0 ) 4 2
   vert 23 ( 0.3125 -0.5 ) 10 2

   numtris 12
   tri 0 2 1 0
   tri 1 2 0 3
   tri 2 6 5 4
   tri 3 6 4 7
   tri 4 10 9 8
   tri 5 10 8 11
   tri 6 14 13 12
   tri 7 14 12 15
   tri 8 18 17 16
   tri 9 18 16 19
   tri 10 22 21 20
   tri 11 22 20 23

   numweights 16
   weight 0 1 0.7386021614 ( -31.9750022888 -32.0249786377 -32 )
   weight 1 2 0.2613978386 ( 31.9750270844 -63.9803352356 -32 )
   weight 2 1 0.7386021614 ( -31.9750022888 -32.0249786377 32 )
   weight 3 2 0.2613978386 ( 31.9750270844 -63.9803352356 32 )
   weight 4 1 0.7387529016 ( -32.0249786377 31.9750022888 32 )
   weight 5 2 0.2612471282 ( -32.0249710083 -63.9803352356 32 )
   weight 6 1 0.7387529016 ( -32.0249786377 31.9750022888 -32 )
   weight 7 2 0.2612471282 ( -32.0249710083 -63.9803352356 -32 )
   weight 8 1 0.5 ( 31.9750022888 32.0249786377 -32 )
   weight 9 2 0.5 ( -32.0249710083 0.0196647644 -32 )
   weight 10 1 0.5 ( 31.9750022888 32.0249786377 32 )
   weight 11 2 0.5 ( -32.0249710083 0.0196647644 32 )
   weight 12 1 0.5 ( 32.0249786377 -31.9750022888 32 )
   weight 13 2 0.5 ( 31.9750270844 0.0196647644 32 )
   weight 14 1 0.5 ( 32.0249786377 -31.9750022888 -32 )
   weight 15 2 0.5 ( 31.9750270844 0.0196647644 -32 )
}

_________________
theRev is coming...



iceheart@Posted: Thu Aug 17, 2006 12:41 am    Post subject: : Why is a cube 24 verts?
_________________
Staff
www.modwiki.net - wiki resource for all Doom 3 engine-based games.



rich_is_bored@Posted: Thu Aug 17, 2006 5:22 am    Post subject: : Ooh it's like a riddle...

Each side is unwelded.
_________________
Staff
Learn something today? Why not write an article about it on modwiki.net?



Rayne@Posted: Fri Aug 18, 2006 8:53 pm    Post subject: : Oh, eheh Rich is right... exported the cube from Radiant and all the faces are separated... Very Happy
_________________
theRev is coming...



Code-R@Posted: Thu Aug 24, 2006 7:27 am    Post subject: : Thanks a million!


kat@Posted: Thu Aug 24, 2006 7:52 am    Post subject: :
Rayne wrote:
Oh, eheh Rich is right... exported the cube from Radiant and all the faces are separated... Very Happy
At least that means you won't get fuglied smoothing on the mesh!
_________________
Co-Admin - Modelling and modding tutorials and tips



Rayne@Posted: Thu Aug 24, 2006 10:50 am    Post subject: : Now that's strange... I've opened the .ma file again and the cube's vertices are perfectly welded... So probably I'll make another test to see how this works.

Strange thing...
_________________
theRev is coming...



Code-R@Posted: Thu Aug 24, 2006 4:32 pm    Post subject: : mind posting the welded version's md5mesh?


der_ton@Posted: Fri Aug 25, 2006 1:32 pm    Post subject: :
Rayne wrote:
Now that's strange... I've opened the .ma file again and the cube's vertices are perfectly welded...

If the vertices need to be separate or not depends on the format. In md5mesh, they need to be separate to signal that they don't share normal vectors. In other formats, there are other ways to represent that information.
_________________
Staff
Modelviewer | 3DSMax<->MD5 | Blender<->MD5



Code-R@Posted: Sat Aug 26, 2006 7:26 pm    Post subject: : I understand that means you can't represent a cube with 8 vertices, but do you need an entire 24 under MD5?


der_ton@Posted: Sun Aug 27, 2006 3:31 pm    Post subject: : Yes, because each of the 8 vertices has 3 different normals, depending on which of the 3 adjacent faces it is part of.
8 x 3 = 24
_________________
Staff
Modelviewer | 3DSMax<->MD5 | Blender<->MD5



Rayne@Posted: Mon Aug 28, 2006 11:25 am    Post subject: : Yeah, I've checked the scene file again and the cube IT'S all welded
_________________
theRev is coming...