View Full Version : UV Coordinates import from 3DS mesh file
i wrote a loader for obj file(wavwe front) which is not having any texture support(bmp file with UV coordinates) to import into my GAME. i want to load the mesh object with textures from the file by generating the textures using the referenced files in the file. so i opted 3DS file and started writing a 3ds loader. but i cant find enough information on decoding the texture coordinates and the corrosponding BMP(or TGa or ...) from the 3DS file. can any one help me. i am writing a free combat flight simulation game.any one help me if u know any tutorial or 3DS loader available over the net. is there is any other file format that supports textures with UV's ?
02-25-2004, 10:14 AM
Hm... I have had no problems with the 3ds loader I grabbed from www.gametutorials.com. (http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg4.htm) I have been using it for quite a while, and have modified it to my tastes... Check it out, it has worked for me since day 1.
[This message has been edited by 147-2 (edited 02-25-2004).]
02-26-2004, 06:15 AM
i advice you honestly NOT TO USE the 3DSLOADER from gametutorials.com - because it's total ****ty: it loads only the first mesh out of the file ! (of course, no problem to extend it by yourself but if i proclaim a loader as "useable" it should be useable, and not only 50% of it!)
02-29-2004, 08:42 AM
I've found Lev's 3ds loader to be a helpful resource while working on my own:
I've also extensively used this reference to decipher the various chunks in the 3ds file:
Hope those links help.
thanku guys but i wrote my own loader that even reads tex coords and loades the textures an dbulds the lists too.the only problem is vertex normals with out them the vertex and every thing else is quiet good except the faces. they are not smmoth at the borders . each face is seperate plane.iwant more smoothed view . is there is any other thing for that thann increasing polygon tessalation(detail)? will vertex normals work? iam still specifying face normals only!
thans for ur time
03-01-2004, 03:25 PM
Generating vertex normals will indeed smooth things out. For each vertex, average the normals of all faces that share that vertex.
03-02-2004, 06:45 AM
Yes, this exactly what 3DSLoader from www.gametutorials.com (http://www.gametutorials.com) does :-p
vertex normals r introducing another problem. the model looks obscurely shaded .what i mean by that is it is having parallel bands in that which are much significant at larger distances and not much problem at less viewing distances from the object.
this is the code for calculating face normals and vertex normals for each individual object in the 3ds file.
void CGLMFC1View::calcAllNormals(MeshObj *p_object)
//first lets calculate the face normals
//get its vertices indexes
//load the 3 vertices in to the array in
//calculate and specify the normal
// now lets calculate the vertex normals by averaging the face normals
//search the for the shared faces of this ith Vertex
if(temp1==l| |temp2==l| |temp3==l)
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.