Original Post
Hey all, I''m writing a maxscript file to export Max files to the format I want them in, it''s going to be pretty standard, but when exporting the texture coordinates for every face''s vertices, I used something like this:
... in somefunction ExportMesh
format "uvcoords %\n" m.numtverts to: outstream
for i=1 to m.numtverts do
(
local v = gettvert m i
format " % % 0 \n" v.x v.y to: outstream
)
.. so this is done for every face in the current mesh being exported... I''m only doing UV coordinates, so no W, which is why i dont use the v.z, so... my problem is, the coordinates that are being output to file aren''t in the range of 0.0f to 1.0f.. they''re actually arn''t anywhere near that range. So i figure MAX does things a little differently... (btw this is 3d studio max 4).. does anyone know how I can convert these texture coordinates to the DirectX 0..1 range? To simplify things, faces are only allowed 3 vertices in my engine, so basically triangles only... my structure goes something like this:
struct sface {
int m_iInds[3]; //indices to vertex list held one level up
float m_fU[3], m_fV[3];
// *snip* everything else like diffuse, normals, etc..
};
Everything else in my script works perfectly, my engine loads the geometry correctly and can render it w/ the diffuse/specular colors... just w/o texture info, and if I feed it texture coords or use directx autogenerate UV coords, the textures are mapped, they just don''t display the way I want them to... (w/ the coordinates from MAX).... so any help would be much appreciated
thanks,
rj