PDA

View Full Version : 3ds file problem



tux
20-10-2004, 04:35 PM
ive got to the stage where im now dealing with the textures in my modeler for my game. im using Mike Lischke's 3ds loader and its going well until this point.

basicly what happens when i go to write the texture coordinates to my file, i get an I/O error 1784 on the 6th mesh in the 3ds model.

here is part of my export code


for iLoop:=0 to Mesh[iObjectLoop].Count -1 do
Begin
BlockWrite(F, Mesh[iObjectLoop].TexCoords[iLoop].S, 4);
BlockWrite(F, Mesh[iObjectLoop].TexCoords[iLoop].T, 4);
end;

the full unit can be found at http://www.vadertrophy.com/~files/uExport.pas

any help is apreciated :)

noeska
20-10-2004, 08:31 PM
Error code 1784 means that the supplied user buffer is not valid for the requested operation.

Does your 6th mesh have texture coords?

Consider using gl3ds instead. It comes complete with a custom exporter you can modify. But it expects texture coords also! Try it with your mesh to see if it works.

tux
20-10-2004, 11:11 PM
hmm. im not in the mood to change loader tonight :)

ill give it a try tomorrow, thanks

tux
21-10-2004, 11:19 AM
i tryed gl3ds and its killed the normals :(

noeska
21-10-2004, 03:36 PM
i know my normals are not working properly. Inside the 3ds files no normals are stored so i had to recalculate them, have a look inside the gl3ds.pas file and have a look at the part that calculates the normals if in your version the real smooth normals part is not commented make it so and run it again. Leave the first part in though!

But does your export work now?

tux
21-10-2004, 05:29 PM
even after commenting it out, still doesnt work

this is with your one
http://www.vadertrophy.com/~files/Image1.jpg

this is with the other one
http://www.vadertrophy.com/~files/Image2.jpg

ures also wont zoom in fully without clipping :?

noeska
21-10-2004, 06:14 PM
hmmmm, i see. Tomorrow i have a go at the normals again.

tux
21-10-2004, 06:41 PM
ive fixed the i/o error in my texture code (with a nasty work around).

if you look at the viewer example on http://lischke-online.de/ in viewer.pas theres a ConvertMeshData procedure. mabey that will help with your normals :)