Forum > General

How to display truncated objects using GLScene

(1/2) > >>

FangQ:
I am writing a rendering program using GLScene and Lazarus. The objects being displayed are basic shapes - boxes, spheres, cylinders etc.

Right now, I can display all objects. I am trying to figure out a way to truncate the 3D objects using a bounding box.

a screenshot of one of the scenes is attached. you can see the sphere extends above the bounding box (a TGLCube object, inside a DummyCube). I am wondering if there is a setting to allow truncation (or Boolean) of the objects.

Although I set all objects transparent, I was hoping to see intersection lines between objects, currently, GLScene does not seem to give me those intersections. Is this supported in this library? (I am using GLScene 1.4)

thanks

Mr.Madguy:
You should understand, that rendering and physics - are two separate things. OpenGL is just renderer, like GDI for example - it can draw primitives and nothing more, so it doesn't support CSG out of box - it's up to you to implement it.

FangQ:

--- Quote from: Mr.Madguy on January 19, 2018, 07:04:33 am ---You should understand, that rendering and physics - are two separate things. OpenGL is just renderer, like GDI for example - it can draw primitives and nothing more, so it doesn't support CSG out of box - it's up to you to implement it.

--- End quote ---

thanks for the reply. I guess I should reword my question a little bit, what I meant to ask was if there are functions/tools in glScene to allow ray-tracing based scene rendering.

after googling for a while, I found the closest thing to my question was the "raycast" example under the samples/collision folder.  see the second from bottom of this page:

http://glscene.pbworks.com/w/page/6437572/doc_demoscollisions

I tried that example, it worked, it gives what I wanted, but right now, looks like this can only be rendered on a separate canvas (TPaintBox) and not in real time.

regarding truncation of a bounding box, I haven't found any thing yet in glscene.

Mr.Madguy:

--- Quote from: FangQ on January 19, 2018, 06:27:26 pm ---thanks for the reply. I guess I should reword my question a little bit, what I meant to ask was if there are functions/tools in glScene to allow ray-tracing based scene rendering.

after googling for a while, I found the closest thing to my question was the "raycast" example under the samples/collision folder.  see the second from bottom of this page:

http://glscene.pbworks.com/w/page/6437572/doc_demoscollisions

I tried that example, it worked, it gives what I wanted, but right now, looks like this can only be rendered on a separate canvas (TPaintBox) and not in real time.

regarding truncation of a bounding box, I haven't found any thing yet in glscene.

--- End quote ---
Raytrace is too slow. From what you've said, I've understood, that you need CSG, i.e. Constructive Solid Geometry. This isn't hard to be implemented manually. Old games, such as Quake, were doing it in real time.

dicepd:
There is a demo of a cube being subtracted from a tessellated star in real time in the examples, though I cannot for the life of me remember which one. This should be the example to go for.

Navigation

[0] Message Index

[#] Next page

Go to full version