DGL
https://delphigl.com/forum/

glModel (.3ds / .obj / Milkshape ascii .txt) Feedback
https://delphigl.com/forum/viewtopic.php?f=14&t=2422
Seite 1 von 7

Autor:  noeska [ So Jan 25, 2004 12:08 ]
Betreff des Beitrags:  glModel (.3ds / .obj / Milkshape ascii .txt) Feedback

Place your comments and feedback on glModel (former gl3ds) here.

It helps me develop it further...

Autor:  Sascha Willems [ So Jan 25, 2004 12:35 ]
Betreff des Beitrags: 

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.

Autor:  noeska [ So Jan 25, 2004 22:53 ]
Betreff des Beitrags: 

this is the kind of feedback i need.

Could you send the 3ds file with the lights to me?

What are vbo's?

Autor:  Sascha Willems [ So Jan 25, 2004 23:15 ]
Betreff des Beitrags: 

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.

Autor:  noeska [ Mo Jan 26, 2004 19:09 ]
Betreff des Beitrags: 

It should load now. It now correctly skips over the light data. The new version (2.1) is available here: viewtopic.php?t=2421

Autor:  KidPaddle [ Mi Jan 28, 2004 11:12 ]
Betreff des Beitrags: 

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.

KidPaddle

Autor:  Sascha Willems [ Do Feb 19, 2004 15:20 ]
Betreff des Beitrags: 

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 :

Code:
  1. Procedure TAll3DSMesh.LoadFromStream(stream: Tstream; meshtype: word);
  2. begin
  3.   _type := meshtype;
  4.   if _type = mesh_3ds then
  5.     Load3DSFromStream(stream);
  6.   if _type = mesh_msa then
  7.     LoadMSAFromStream(stream);
  8. end;


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.

Autor:  noeska [ Do Feb 19, 2004 20:24 ]
Betreff des Beitrags: 

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.

Autor:  Sascha Willems [ Do Feb 19, 2004 20:30 ]
Betreff des Beitrags: 

Ah, sorry. Didn't see that one, but kind is kind of a strange name ;)

Autor:  Flash [ Fr Feb 20, 2004 16:52 ]
Betreff des Beitrags: 

If you can't use "type" then "Meshtype" is maybe a Keyword a user would expect.

Like SOS said: "kind is kind of a strange name."

Autor:  noeska [ Fr Feb 20, 2004 19:07 ]
Betreff des Beitrags: 

i know kind is kind of a strange name. I change it to meshtype in the next release.

Autor:  Mars [ Sa Feb 21, 2004 18:19 ]
Betreff des Beitrags: 

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 :wink: ).

Maybe you should change the following:
Code:
  1. Procedure TAll3DSMesh.LoadFromFile(filename:string);
  2. Begin
  3.   if UpperCase(copy(filename, length(filename)-3, 4)) = '.3DS' then
  4.     Load3DSFromFile(Filename);
  5.   if UpperCase(copy(filename, length(filename)-3, 4)) = '.TXT' then
  6.     LoadMSAFromFile(Filename);
  7. End;
  8.  

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 :wink:

Autor:  noeska [ So Feb 22, 2004 16:06 ]
Betreff des Beitrags: 

gl3ds is Work In Progress, meaning that it is not finished yet. Take a look at the latest release to see it is somewhat cleaner now.

PS you can now create your own 3ds meshes with materials at runtime.

Autor:  Mars [ So Feb 22, 2004 17:30 ]
Betreff des Beitrags: 

The new source is much prettier to look at :wink: - great work.

Autor:  Flash [ Mo Mär 15, 2004 15:50 ]
Betreff des Beitrags: 

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
Code:
  1. procedure Load3DModels;
  2. // Laden der 3D Modelle für das Spiel
  3. begin
  4.      GVModels[0] := TAll3DSMesh.Create(nil);
  5.      GVModels[0].LoadFromFile(ExtractFilePath(ParamStr(0))+'Models\Dorf.3DS');
  6. end;


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?

Seite 1 von 7 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/