Game Development Community

DTS format question

by Danny Goss · in Torque Game Engine · 06/17/2005 (11:41 am) · 3 replies

I am attempting a DTS conversion program and I have been studing the DTS format for quite a while now. I have been reading through ms2DTS, DTSSDK, DTSSDKPlus, and the tsShape code and I keep getting confused about the relationship between some of the vector list. This question is specificly about the mesh.

In a mesh, can a vertex in the vertex list have more than one texture coordinate? Looking at the milkshape export it looks like each vertex can only have one tex coordinate. If you can have more than one tex coord, then how are the verts, tverts, normals, enormals, primitives, indices, mindices vindex, vbone, vweight, nodeIndex vectors used in relation to one another? Most of them look like parallel list.


The reason I am confused is because there is a vertices list called verts and a texture coordinate list called tverts. There is an index list into the vertices list and there is not one for the tverts list so I am assuming that the same index will be used which means there can only be one texture coordinate per vertex. However, can a vertex not have more than one texture coordinate in a 3D model?

Thanks for any help.

Danny

#1
07/10/2005 (8:04 pm)
I got the verts, tex, and normals thing down now and I am building a DTS file that loads without any errors, but the object is not being rendered. What I am building is a simple cube. In fact, I dumped the cube exported from the milkshape exporter and am pretty much building the same object for my exporter program. Comparing the files in a Hex editor I can see some different values between the milkshape cube DTS file and the cube DTS file i created. I'm sure it is something in the mesh that I am not doing correctly, I just have not found it yet. I know the difference between the two files come after the 15 checkpoint (the 15 checkpoint is after the mesh type) and before the names table so it has to be in the mesh object. Unless someone has an Idea what I may have forgot, I have to go through file and debug the writing of the mesh to figure out what I forgot to do. Debuging is not a problem, It's just I do not have much time as it has taken me over 3 months to get this far in creating a DTS file.

Thanks for any help

Danny
#2
07/16/2005 (11:17 pm)
I have found what is causing the mesh not to render but I don't know what it is. There is one byte that I can change the value to 20 and the shape will render. I am having trouble finding out what that byte is though. In the file I have found where the indices size is written. It is a 32 bit number. The next 4 bytes are all value 0. The next byte in the file I created was value 0, but in the file created byte the Milkshape exporter the byte is value 20. If I change this byte, the mesh will render. Looking at this byte's position in the file in a hex editor, I would say that it is a 32 bit number, but I have not been able to figure out what it is. I thought that after the number of indices, there were suppose to be the indices (16 bit numbers), but that does not appear to be the case.

Here is how I thought primitives and indices were stored in the file.

Number of primitives (32 bit number)
first index (16 bit number)
Num of indices (16 bit number)
type (32 but number) For each primitive
Number of indices (32 bit number)
index (16 bit number) For each index

but what is created from the milkshape exporter is something more like this
Number of primitives (32 but number)
type (32 bit number) For each primitive
Number of indices (32 bit number)
4 bytes I don't know (32 bit number???)
4 bytes I don't know (32 bit number???? -> this is the one that prevent my mesh from being rendered
4 more 32 but numbers I don't know what they are
several 16 bit number????????????

I don't know what going on. It's late - I'm going to bed

Good night.

Danny
#3
01/16/2009 (5:57 pm)
http://www.garagegames.com/community/forums/viewthread/48429

Maybe your answer is there.
I hope that helps.