Odd DTS Exporter Problem
by James Urquhart · in Torque Game Engine · 08/19/2003 (7:28 am) · 2 replies
I am currently writing a DTS exporter for my favourite modelling program, based upon "ms2dts" from the torque cvs.
However, i am having lots of problems when i try and apply textures to the model i am exporting, which i did not run into before (and i do not use cvs/subversion so i cannot rollback the changes i made to the code to see what i broke :( )
The Model (Simple Square) should look like, and used to look like :

But now it ends up looking like :

I'm pretty sure that the texture co-ordinates themselves are being written correctly, aswell as the vertexes, meshes, etc.
I really can't figure out what the problem is.
Does anyone have any idea what i am doing wrong? Have i written some incorrect flags somewhere?
I have 1 material, and it has these flags :
"SWrap", "TWrap", "NeverEnvMap", "NoMipMap"
The mesh has no flags (0)
I am writing a mesh "Plane", these vertexes :
The Exporter reports it has written :
(Vertex followed by tex coord)
Thanks for any help.
However, i am having lots of problems when i try and apply textures to the model i am exporting, which i did not run into before (and i do not use cvs/subversion so i cannot rollback the changes i made to the code to see what i broke :( )
The Model (Simple Square) should look like, and used to look like :

But now it ends up looking like :

I'm pretty sure that the texture co-ordinates themselves are being written correctly, aswell as the vertexes, meshes, etc.
I really can't figure out what the problem is.
Does anyone have any idea what i am doing wrong? Have i written some incorrect flags somewhere?
I have 1 material, and it has these flags :
"SWrap", "TWrap", "NeverEnvMap", "NoMipMap"
The mesh has no flags (0)
I am writing a mesh "Plane", these vertexes :
-10.0000019073 10.0 0.0 -10.0000019073 -10.0 0.0 10.0 -10.0 0.0 10.0000038147 10.0000019073 0.0These corresponding Tex Coords :
0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0All vertexes have this normal :
0.0 0.0 1.0And these triangles (Vertex Numbers) :
1 2 3 0 1 3
The Exporter reports it has written :
(Vertex followed by tex coord)
DEBUG: WRIT -10.000002 10.000000 0.000000 DEBUG: WRIT 0.000000 0.000000 DEBUG: WRIT -10.000002 -10.000000 0.000000 DEBUG: WRIT 0.000000 1.000000 DEBUG: WRIT 10.000000 -10.000000 0.000000 DEBUG: WRIT 1.000000 1.000000 DEBUG: WRIT 10.000004 10.000002 0.000000 DEBUG: WRIT 1.000000 0.000000
Thanks for any help.
About the author
#2
08/19/2003 (9:19 am)
Have you confirmed that the UV co-ords are being read properly, and more importantly, are actually correct in the TSShape?
Associate James Urquhart
The problem was in when i was writing the "Object State" data. It seems i changed one part of the code, but forgot about the other bit, so it was writing invalid values, somehow causing the texture map to go wierd =)