Registriert: Mo Sep 23, 2002 19:27 Beiträge: 5812
Programmiersprache: C++
Can't tell you about 2.0, but I've benn using an older version of your 3DS-Header (v1.9) and it's a great loader, so much less pain using it than that overloaded 3DS-Loader from Mike Lischke. The good thing about your loader is the fact that it's source is so easy to modify, and I've added several things like material sorted VBOs, calculation of Tangents (not working 100% for now) and generation of bounding boxes to it (and the dglOpenGL.pas).
But I've noticed one small problem with 1.9 (perhaps you have already fixed it) : The loder seems to mistake lights for meshes. So I had a scene consisting of 60 meshes and two lights, and it skipped two meshes and took the lights for it, so that I had two empty meshes. So I had to delete the lights before exporting my scene to 3DS.
Registriert: Mo Sep 23, 2002 19:27 Beiträge: 5812
Programmiersprache: C++
I'll attach a file that shows the problem. The creation order was as follows :
- Sphere
- Cylinder
- Light 1
- Light 2
- Box 1
- Box 2
If you load the file and display it, then you'll only see the cylinder and the sphere, cause the loader thinks light1 and light2 are regular meshes. The meshcount will be 4, but since the loader mistakes the lights for meshes, mesh 3 and 4 will contain of zero vertices. If you remove the lights and export save the file again, then everything is as it shoudl be.
noeska hat geschrieben:
What are vbo's?
VBO stands for Vertex Buffer Object and is a new OpenGL-object type that allows you to store vertices directly in the VRAM. It's kind of a successor of display lists, but won't store statechanges. To get most out of modern graphicsboards, it's best to feed them the vertices via VBOs.
Registriert: Mo Jan 20, 2003 20:10 Beiträge: 424 Wohnort: nähe Starnberg
Delphi 7 reports many warnings( 12 ) und Hints( 8 ) by compiling your unit. The most important is a missing override statment of TAll3dsMesh.Destroy. This is a warning for memory leaks, if i use FreeAndNil(SampleAll3dsMesh). In this case, your destructor is never called.
I replaced the unit DGLTextures by glBitmap, cause didn't not found those unit.
Registriert: Mo Sep 23, 2002 19:27 Beiträge: 5812
Programmiersprache: C++
Please forgive me if that has already been fixed, but due to some major changes in gl3DS.pas I can't use your newest version :
I've noticed a severe problem when loading a file from a stream. In my current project I'm loading all data from a stream (as all data is in a single package), and your function TAll3DSMesh.LoadFromStream needs to know what type of mesh it is (3DS or MS3D). That type is stored in TAll3DSMesh._type, but since it's private, you can't access it from outside of gl3ds.pas to tell the loader what kind of model to load from the stream.
That means that when you just do a TMyAll3DSMesh.LoadFromStream(MyStream), nothing will be loaded since the loader doesn't know what type of model it is.
So either make the _type-propertie of TAll3DSMesh public, or (better in my opinoion) change the LoadFromStream-function to something like this :
But besides that fault, again thumbs up for that great loader. I can't tell this often enough, but Mike Lischke's loader was so a pain-in-the-ass, that I'm really glad you wrote a 3DS-Loader that one can use AND change.
Registriert: Di Jul 01, 2003 18:59 Beiträge: 887 Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
It is there but it is named kind. I did not dare to name the property type as that already is a object pascal keyword. The kind property is explained in the documentation.
I'm at the work of implementing your code into the "BaseLevelBaker" (the gl3ds code is not so pretty formatted, but changing the code to one's personal needs (ie. "rendering" into an own object format instead of OpenGL) works like a charm - thumbs up ).
if UpperCase(copy(filename, length(filename)-3, 4)) = '.3DS' then
Load3DSFromFile(Filename);
if UpperCase(copy(filename, length(filename)-3, 4)) = '.TXT' then
LoadMSAFromFile(Filename);
End;
Because the loader only "knew" only ".3ds" and no ".3DS", which was a bit disturbing at the beginning.
- and perhaps you could do something about the Hints and Warnings, because they are not too pretty - however, I have to agree to SoS, that implementing your code is much more flexible than Lischkes Behemoth
Registriert: Do Sep 25, 2003 15:56 Beiträge: 7804 Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
I have downloaded Version 2.1c (latest Version?).
When do you change to DGLopenGL.pas?? Can I change it for my Project? Are there problems when I change to DGLopenGL?
EDIT: I've tested it but something is wrong...
I've defined a globalvar named GVModels ( = array[0..1] of TAll3DSMesh)
When i start an "New Game" the models are loaded correctly (I hobe) by
In my render procedure I call GVModels[0].render.
Compile -> OK, Test -> EAccessViolation (gl3DS Line 499)
There is one more question. My 3DS Mesh is textured. Are the Textures saved in the .3DS File? If not, how should I manage this? Even if I put the Textures in a subfolder of my project, the saved path to the textures wouldn't be correct. Could you (or someone else) explain how to handle textured models?
_________________ Blog: kevin-fleischer.de und fbaingermany.com
Mitglieder in diesem Forum: 0 Mitglieder und 2 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.