OpenGLES

Anything and everything about programming graphics with Ultibo
Gavinmc42
Posts: 1339
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

OpenGLES

Postby Gavinmc42 » Wed Jun 27, 2018 6:26 am

Things have finally gelled for me about how 3D works.
https://www.raspberrypi.org/forums/view ... 8&t=214695

Posted on a Pi forum, an obj to opengles parser
https://kivy.org/docs/examples/gen__3Dr ... n__py.html
Even I may be able to make a unit out of that?

Any Pascal CAD/obj viewer code around?
One of them may just port.
Gavinmc42
Posts: 1339
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: OpenGLES

Postby Gavinmc42 » Sat Jun 30, 2018 8:26 am

Don't want to lose this one, it actually is in Pascal :D
https://git.bergmann89.de/opengl
Gavinmc42
Posts: 1339
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: OpenGLES

Postby Gavinmc42 » Tue Jul 03, 2018 12:59 am

Buried in the normal Lazarus/FPC components is this example testopenglcontext1.lpi
Putting it here because it is hard to find.
It just happens to be the spinning cube demo.

Hacking this code helps to learn how to hack Ultibo OpenGLES2 spinning cube example.
The GL_QUADS need to be converted to 2 x GL_TRIANGLES as OpenGLES does not do quads.
Debugging OpenGLES in Ultibo is not easy, so having a Laz example helps.

The OpenGL Starship example is all triangles.
https://www.raywenderlich.com/48299/exp ... -es-part-3
The 6 cube quads are relatively easy to convert into the 6 triangles for the Starship hull.
Once you get your head around thinking in x,y,z dimensions ;)

I understand now why people persist with learning Blender, making 3D shapes in OpenGL/ES by hand is hard.
If you have tried to learn Blender and failed try this first.
https://www.bforartists.de/
"Blender for Dummies" helps too :oops:

Return to “Graphics”

Who is online

Users browsing this forum: No registered users and 0 guests