thanks for developing this incredibly useful library. I could write 3D rendering
applications without delving into OpenGL, it is so much easier with GLScene.
I do have a couple of questions related to object rendering.
first, if I create a patch-like object, like TGLDisk or TGLPolygon, I could only render
one side of it, but when rotating to the back-side, it is completely invisible.
I posted my question at Lazarus forum, one of the users suggestd to change
GLView.Buffer.FaceCurlling setting, this does help, but it causes other issues,
such as showing internal segments in semi-transparent objects.
You can see my original question in this forum thread:
I am wondering if there is a better way to show a patch object? I can replace
a disk with a short cylinder, but I am not sure how to replace TGLPolygon.
the 2nd question is related to creating booleans of multiple simple geometries
(such as TGLSphere, TGLGrid, TGLCylinder etc). I was able to locate the CGS example
for the TGLMeshObject, but I am not sure how to convert simple geometries to
MeshObject.
I posted this question in another thread at the Lazarus forum,
love to hear your opinion how to make this possible
Hi Qianqian, sorry not saw your post on FreePascal forum. For making CSG from TGLSphere, TGLCube you need to transform those objects into mesh before. For making this transformation you can use TGLFeedBack (see in sample) But i recommend you build directly your TGLMeshObject like Dicepd suggest you. You can also take a look at this https://sourceforge.net/p/glscene/discussion/93606/thread/44c2c3b7/2f3b/attachment/glfreeformex.pas for building FreeForm. Take also a look, in GLMeshBuilder unit
Cheers
Last edit: Jerome.D (BeanzMaster) 2018-01-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thank you Jerome, the example is very helpful. looks like the TGLFreeFormEx.BuildMeshObjectFrom() function is exactly what I need.
on a related note, I have been working 2D/3D mesh generation for a quite while, I know that it has been really difficult to perform surface boolean operations on overlapping/degenerated surfaces. I have been using Cork in the recent year (https://github.com/gilbo/cork) but still it fails when merging two co-planar surfaces. The old GTS library fails in even more cases.
I am curious what underlying library does GLScene use for surface boolean operations? is this library robust enough for rigirous mesh processing, or it is for rendering purposes only (thus small errors is acceptable)?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
By a "patch", I meant the basic objects like TGLDisk, TGLPolygon, TGLPlane etc, where it is an open-surface (not like a closed surface such as a TGLSphere or TGLCylinder).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am curious what underlying library does GLScene use for surface boolean operations?
GLScene use internal code no external lib. After tell you if it's robust like you want, don't say you must do some test yourself.
For two siding lighting see in GLSceneBuffer options (in TGLSceneViewer) (sorry i can't check atm, ihaven't got glscene installed (i'm working on the next update)
I am curious what underlying library does GLScene use for surface boolean operations? is this library robust enough for rigirous mesh processing, or it is for rendering purposes only (thus small errors is acceptable)?
from GLMeshCSG unit :
The CSG system uses BSP to optimize what triangles it considers.
Its kept on a mesh basis to simplyfy things, it allways generates new BSP's,
even if the meshes allready had BSP optimization.
So surely some minors errors, but depends of the complexity of your mesh
Last edit: Jerome.D (BeanzMaster) 2018-01-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear GLScene experts,
thanks for developing this incredibly useful library. I could write 3D rendering
applications without delving into OpenGL, it is so much easier with GLScene.
I do have a couple of questions related to object rendering.
first, if I create a patch-like object, like TGLDisk or TGLPolygon, I could only render
one side of it, but when rotating to the back-side, it is completely invisible.
I posted my question at Lazarus forum, one of the users suggestd to change
GLView.Buffer.FaceCurlling setting, this does help, but it causes other issues,
such as showing internal segments in semi-transparent objects.
You can see my original question in this forum thread:
https://forum.lazarus.freepascal.org/index.php/topic,39823.0.html
I am wondering if there is a better way to show a patch object? I can replace
a disk with a short cylinder, but I am not sure how to replace TGLPolygon.
the 2nd question is related to creating booleans of multiple simple geometries
(such as TGLSphere, TGLGrid, TGLCylinder etc). I was able to locate the CGS example
for the TGLMeshObject, but I am not sure how to convert simple geometries to
MeshObject.
I posted this question in another thread at the Lazarus forum,
love to hear your opinion how to make this possible
https://forum.lazarus.freepascal.org/index.php/topic,39708.0.html
thanks
Qianqian
Hi Qianqian, sorry not saw your post on FreePascal forum. For making CSG from TGLSphere, TGLCube you need to transform those objects into mesh before. For making this transformation you can use TGLFeedBack (see in sample) But i recommend you build directly your TGLMeshObject like Dicepd suggest you. You can also take a look at this https://sourceforge.net/p/glscene/discussion/93606/thread/44c2c3b7/2f3b/attachment/glfreeformex.pas for building FreeForm. Take also a look, in GLMeshBuilder unit
Cheers
Last edit: Jerome.D (BeanzMaster) 2018-01-28
thank you Jerome, the example is very helpful. looks like the TGLFreeFormEx.BuildMeshObjectFrom() function is exactly what I need.
on a related note, I have been working 2D/3D mesh generation for a quite while, I know that it has been really difficult to perform surface boolean operations on overlapping/degenerated surfaces. I have been using Cork in the recent year (https://github.com/gilbo/cork) but still it fails when merging two co-planar surfaces. The old GTS library fails in even more cases.
I am curious what underlying library does GLScene use for surface boolean operations? is this library robust enough for rigirous mesh processing, or it is for rendering purposes only (thus small errors is acceptable)?
Sorry only answer to one question.
What do you call Patch ? Bezier Patch ? Spline Patch ? Edges like sillouhette ?
By a "patch", I meant the basic objects like TGLDisk, TGLPolygon, TGLPlane etc, where it is an open-surface (not like a closed surface such as a TGLSphere or TGLCylinder).
Ok i understand better
GLScene use internal code no external lib. After tell you if it's robust like you want, don't say you must do some test yourself.
For two siding lighting see in GLSceneBuffer options (in TGLSceneViewer) (sorry i can't check atm, ihaven't got glscene installed (i'm working on the next update)
from GLMeshCSG unit :
So surely some minors errors, but depends of the complexity of your mesh
Last edit: Jerome.D (BeanzMaster) 2018-01-29