Recent

Author Topic: is any library can load a 3d format file to opengl api?  (Read 5893 times)

greenzyzyzy

  • Full Member
  • ***
  • Posts: 249
is any library can load a 3d format file to opengl api?
« on: May 16, 2023, 05:25:51 pm »
is any library can load a 3d format file to opengl api?
use with glBegin,glEnd,glNewlist,glEndlist

Seenkao

  • Hero Member
  • *****
  • Posts: 609
    • New ZenGL.
Re: is any library can load a 3d format file to opengl api?
« Reply #1 on: May 16, 2023, 07:48:01 pm »
  Лично я не понял что вы хотите!
  Какой именно формат вы хотите загрузить? Есть достаточно немало приложений, которые были сделаны в конце прошлого века и в начале нынешнего века, которые работают с 3D. Вам надо лишь найти код того времени, который работал с 3D в OpenGL.
  Так же, вы можете посмотреть книги того времени, возможно в них вы найдёте ответ на свой вопрос.

Google translate:
  Personally, I did not understand what you want!
   What format do you want to download? There are quite a few applications that were made at the end of the last century and at the beginning of this century that work with 3D. You just need to find the code of the time that worked with 3D in OpenGL.
   Also, you can look at the books of that time, perhaps in them you will find the answer to your question.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

wp

  • Hero Member
  • *****
  • Posts: 12419
Re: is any library can load a 3d format file to opengl api?
« Reply #2 on: May 16, 2023, 11:59:11 pm »
3d file formats are supported by GLScene (install from OPM). But my recent tests with GLScene showed that the Lazarus version of this library is not working very well.

I wrote a viewer for the STL format by myself - see attachment. The reader for the STL format is in unit svSTLFile. Note that this code is not finished, mouse handling, camera and light parameters should be improved.

greenzyzyzy

  • Full Member
  • ***
  • Posts: 249
Re: is any library can load a 3d format file to opengl api?
« Reply #3 on: May 17, 2023, 03:42:14 am »
thanks for replies.but how about BGRABitmap?

greenzyzyzy

  • Full Member
  • ***
  • Posts: 249
Re: is any library can load a 3d format file to opengl api?
« Reply #4 on: May 17, 2023, 03:54:22 am »
3d file formats are supported by GLScene (install from OPM). But my recent tests with GLScene showed that the Lazarus version of this library is not working very well.

I wrote a viewer for the STL format by myself - see attachment. The reader for the STL format is in unit svSTLFile. Note that this code is not finished, mouse handling, camera and light parameters should be improved.

Does GLScene can load a 3d format file for OPENGL api?just like 3ds gltf or other animate mode
i want to use it in OPENGL api.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8772
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: is any library can load a 3d format file to opengl api?
« Reply #5 on: May 17, 2023, 08:37:46 am »
Does GLScene can load a 3d format file for OPENGL api?just like 3ds gltf or other animate mode
i want to use it in OPENGL api.
OpenGL does NOT understand any 3D format, it only understands pure RGB(A) arrays and texture mapping. How the 3D is structured is totally your responsibility. I had a 3DS loader back then, might still be in my archive somewhere.

greenzyzyzy

  • Full Member
  • ***
  • Posts: 249
Re: is any library can load a 3d format file to opengl api?
« Reply #6 on: May 19, 2023, 12:45:49 pm »
Does GLScene can load a 3d format file for OPENGL api?just like 3ds gltf or other animate mode
i want to use it in OPENGL api.
OpenGL does NOT understand any 3D format, it only understands pure RGB(A) arrays and texture mapping. How the 3D is structured is totally your responsibility. I had a 3DS loader back then, might still be in my archive somewhere.

ok,thank you.

TRon

  • Hero Member
  • *****
  • Posts: 3520
Re: is any library can load a 3d format file to opengl api?
« Reply #7 on: August 23, 2024, 02:29:03 am »
I need STL files? Where I can download some files *.stl?
ddg stl file examples

Which directs us for example to:
https://grabcad.com/library/software/stl
https://www.thingiverse.com
This tagline is powered by AI

DomingoGP

  • Jr. Member
  • **
  • Posts: 80
Re: is any library can load a 3d format file to opengl api?
« Reply #8 on: August 23, 2024, 02:28:05 pm »
I need STL files? Where I can download some files *.stl?

In this page you can found some good classical art models.

https://www.myminifactory.com/scantheworld/full-collection?sort=popularity

d2010

  • Jr. Member
  • **
  • Posts: 59
Re: is any library can load a 3d format file to opengl api?
« Reply #9 on: October 06, 2024, 07:39:24 am »
Thank you for your Links, are very goods.
I put here a nw verions of STL-viewer.
-a) I add Time-of Loading.
-b)Rotate in 3D is very good
-c)I display the grid of UcsPlaneX

Can you put more models for 3dAxes? e.g. you replace red-lines to more other types-of-lines.
« Last Edit: October 06, 2024, 07:42:49 am by d2010 »

Dzandaa

  • Sr. Member
  • ****
  • Posts: 369
  • From C# to Lazarus
Re: is any library can load a 3d format file to opengl api?
« Reply #10 on: October 06, 2024, 11:39:13 am »
Hi,

Does the color of the faces match the orientation of the normal's?
If so, there are errors in the orientation of some faces.


B->
Regards,
Dzandaa

Dzandaa

  • Sr. Member
  • ****
  • Posts: 369
  • From C# to Lazarus
Re: is any library can load a 3d format file to opengl api?
« Reply #11 on: October 06, 2024, 12:06:03 pm »
Hi,

Sorry for the previous question,
I looked at the code and found that the color of the faces is just an increment. Nothing to do with normals.

Code: Pascal  [Select][+][-]
  1.   for i:=High(FData) downto 0 do
  2.     with FData[i] do begin
  3.          case gc and 3 of
  4. 07:    glColor3f(Red(c)/255, Green(c)/255, Blue(c)/255);
  5. 01:    glColor3f(Red(c)/255, 000000000000, 00000000000);
  6. 02:    glColor3f(0000000000, Green(c)/255, 00000000000);
  7. 03:    glColor3f(0000000000, Green(c)/255, Blue(c)/255);
  8.            End;
  9.       glBegin(trip[i and 1]);
  10.         glNormal3f(Normal[0], Normal[1], Normal[2]);
  11.         glVertex3f(Vertex1[0], Vertex1[1], Vertex1[2]);
  12.         glVertex3f(Vertex2[0], Vertex2[1], Vertex2[2]);
  13.         glVertex3f(Vertex3[0], Vertex3[1], Vertex3[2]);
  14.       glEnd;
  15.       inc(gc);
  16.   end;  
Regards,
Dzandaa

 

TinyPortal © 2005-2018