Advertisement

uvw, max and texcoords

Started by August 22, 2002 09:43 PM
2 comments, last by modification 22 years, 6 months ago
ello all, i've finally got my textures to display and lo and behold another prob has come up.... i am loading the model information from an ASE file exported from 3ds max including the UVW coords for each point on the mesh... trouble is i cant work out which way up/down/left/right they go... the model itself is rotated in the draw function like so (not the best method i know) glRotatef(90,0,0,1); glRotatef(90,0,1,0); but my uvw coords are not i think. can some1 show me a better way of doing this that mite sort my UVW prob out too? i think its just a simple bit of math and swapping the x, y an z values around when they are read in but i cant get my head round it. :| Mod ps. i'm also not quite sure which UVW coords to use for the x and y coordinates for the glTexCoord2f() here is a little sample of the ASE.... *MESH_TVERT 0 0.999500 0.888501 0.000499 [edited by - modification on August 22, 2002 10:50:07 PM]
?
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Advertisement
i''m having trouble explaining this prob. i didnt have the prob i thought i did.. just bear with me a sec....


the ASE reading functions work fine. it reads in the mesh, the texture vertices and the texture faces. it displays my aircraft carrier really nice. got all the materials (windows and things) to look great too.

but... the way the ASE file holds the UWV coordinates for the mesh seems to chop and change depending on some unknown factor lol.


if i texture map a cube in max and then export it to an ASE and read it in, i get lines of symmetry in the texture due to the way the UVW mappings are defined (CW or CCW maybe) for the triangles


Fig 1.1 - The Cube in 3DS MAX
http://hyp.servequake.com/3ds.jpg
i''ve just textured the carriers deck markings onto it as you can see. all looks well

Fig 1.2 - The cube in openGL
http://hyp.servequake.com/opengl.jpg
as you can see the UWV mapping coords must flip depending on which way round they''re defined in the ASE


what i wanna know is.... how do i deciede on a large polygon model which way round to take the coordinates to stop this flipping? i''m sure some1 must have had this problem before



Mod

ps. if you wanna see my code then ask and i shalt provide
Okay, here''s another shot at it. To be honest, I''ve never dealt with ASE files, so I may be shooting into the dark here (which I am), and I don''t really have the patience to read through the following document, but it seems to have what you''re looking for:

Here

Just scroll down a little to get to the uvw texture coordinates bit.

Hope this helps,
Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared

This topic is closed to new replies.

Advertisement