Jump to content
  • Advertisement
Sign in to follow this  
MickeMan

ASE Texture format

This topic is 3920 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm importing and displaying a mesh using the ASE format and so far I'm able to display all vertices and faces with materials. Next step is to apply the texture. First I get the texture filename. And then I look through the file with the texture info for the mesh, it looks something like this:
*MESH_NUMTVERTEX 40
		*MESH_TVERTLIST {
			*MESH_TVERT 0	0.0005	0.6256	0.5090
			*MESH_TVERT 1	0.1700	0.6256	0.0061
			*MESH_TVERT 2	0.1973	0.9803	0.4993
...

*MESH_NUMTVFACES 76
		*MESH_TFACELIST {
			*MESH_TFACE 0	3	1	0
			*MESH_TFACE 1	0	2	3
			*MESH_TFACE 2	7	6	4
...
Looking at this and the documentation for the ASE format I get a bit confused. I'm assuming(after looking at the documentation) that the MESH_TVERT line representes the following: *MESH_TVERT <id> <float u> <float v> <float w> Okay, all good, I'm not planning on using the 'w' value and only stick to basic UV mapping. And then we move on to the MESH_TFACE: *MESH_TFACE <id> <VERT_ID 1> <VERT_ID 2> <VERT_ID 3> And now I lost it. Does a face suddenly have 3 UV coordinates? If we assume that we start at the vertex at index 0 of a triangle, why would we ever bother sending UV coordinates for the other two vertices?

Share this post


Link to post
Share on other sites
Advertisement
You can just forget about W-coord and use UV only.
For example,if you have
*MESH_TVERT 0 0.0005 0.6256 0.5090
*MESH_TVERT 1 0.1700 0.6256 0.0061
*MESH_TVERT 2 0.1973 0.9803 0.4993
*MESH_TVERT 3 0.4300 1.0500 0.6666
............
and
*MESH_TFACE 0 3 1 0 - you can assign for 0 face vertices UV
as follows:
( 0.4300 1.0500 ) (0.1700 0.6256) (0.0005 0.6256)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!