Sign in to follow this  
Kumado

3DS file textures

Recommended Posts

I have MANY tutorials, links and Google pages, I wrote a hex dump program to look at the 3DS files, found and use ghex as well to get a file dump and read the file directly. I have trouble reading other peoples code alot, so is there someone just willing to work directly with me please? I can read a lot of the information from a 3DS file format at this point but I can not figure out the texture map coords. I used a simple block and a pair of block. I applied a texture to each, different ones to the pair of blocks, I also made a block ( cube if you will ) that I shifted the image to use only one portion of the image on the face of the block. I want to be able to use the objects from the 3DS in an OpenGL environment. I have the blocks' vertices, I do not understand how to find, get, convert, contrive, whatever the texture mapping coords for the faces of the block. I find the 4120 block and it has a number pattern as though it were indices I find no 4140 block. No floating point coordinates. I am could easily have not exported correctly from Blender, I may not have UV mapping applied right. Some sort of code would be fine but I really want information more. I can open the file, read into the file, find the texture name, the object name, the object vert list and so on but the texture mapping coordinates is lost to me. Is there enough information to help me out some? Thanks much in advance kumado

Share this post


Link to post
Share on other sites
The UV coord chunk header is 0x4140, which should contain 2x float: U and V.

There should be one UV coord per vertex, and they should be in the same order you loaded the vertices.

I had a few problems with Blender, it wouldn't export the UV coords at all even with the correct options set. Made coding a 3DS loader hell.

If you have 3DS Max anywhere, make yourself a cube with a texture just for testing purposes. Ask Google about Blender and 3DS export.


EDIT: Sorry, my mistake. Chunk 0x4140 contains a quantity (short int) and THEN a stream of UV coords, 2x float each.

Share this post


Link to post
Share on other sites
hmmmm, that will sure stink if I been beating my head over that type of thing.
I guess I should have looked into that possibility as well.
Thanks so much for the help, I am going to find a station for MAX now.

Kumado

Share this post


Link to post
Share on other sites
Glad it works!

If I remember correctly, it was the method of applying the textures in Blender that didn't agree with the exporter.

I haven't used Blender in a while, but I think you can apply a texture using the Materials GUI, or by using the UV Image Editor thing. Try whichever method you didn't use...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this