Archived

This topic is now archived and is closed to further replies.

MarkO

Convert Max .ase 3d texture coord to DX uv coord?

Recommended Posts

I am currently using the .ase file format from 3DSMax v4 in max we are using spherical, cylindrical mapping to map textures to various objects The .ase format spits out x,y,z texture coords for each texture I am trying to figure out how to convert those into uv coords...i know its possible because from a 3ds file using the convrt3ds program it spits out the 2d uv coords I am looking for any good methods to use the texture coords generated in Max in my D3D8 application any tips,pointers,books on this subject would be appreciated

Share this post


Link to post
Share on other sites
Hi !
I had this problem over 2 week ago, this formula send me solosnake, (www.solosnake.fsnet.co.uk), now all warking not better. But I have one problem with multi-material(when more then one material on object) all texture coordinates look not correctly, I don''t now this is my problem(convertor problem from ase) or max not exported correctly , if you deside solve this problem , please write me (mailolegy@mail.ru), whith best regards
Sheeva.
P.S. sorry for my English )
dUF = The material''s UVW_U_TILING
dVF = The material''s UVW_V_TILING
dUO = The material''s UVW_U_OFFSET
dVO = The material''s UVW_V_OFFSET
dScaleOU = -0.5 - dUF / 2.0
dScaleOV = -0.5 - dVF / 2.0
u = U texture co-ordinate for vertex
v = V texture co-ordinate for vertex

Then the DirectX co-ordinates should be:

dxU = -dUO * dUF + dScaleOU + dUF * u
dxV = - ( dVO * dVF + dScale -1 + dVF * v )

Share this post


Link to post
Share on other sites
Hey thanks for the formulas...I had finnally figured out to use 1-u and 1-v to figure out my u v coords for dx since all my tiling was 1 and offset 0 but i will save the rest of the formula in the event we do anything funky with that stuff...i finnaly got my mesh displayed in my 3d environment but i am still getting a wierd effect at what appears to be the texture seam area where i get some extra texture all squished up between what should be the correct texture...has anyone seen this before?

Two more questions if anyone has figured this out
When i compare the .x file and .ase file of the same mesh i have more texture vertices than i do mesh vertices why? they match up in u v coords 1 for 1 then i run out of mesh vertices but ihave texture vertices left over

When i compare the mesh vertices in the ase file i have fewer mesh vertices than in the .x file although same number of faces??

Finally does anyone know what that ab ac ca info does?

Frustrated...almost have a working mesh

Share this post


Link to post
Share on other sites
Well i seemed to have found the solution to my overall problem
It seems the ase file format keeps two indexed lists one of mesh triangles and one of texture triangles..
Now all i have to do is read in the correct indexed texture coords and recollapse my mesh vertex list in the hope of keeping an indexed list of mesh vertices
sigh the end is in sight...

Share this post


Link to post
Share on other sites