View previous topic :: View next topic |
Author |
Message |
herbert Member
Joined: 03 Mar 2006 Posts: 3
|
Posted: Fri Mar 03, 2006 4:32 pm Post subject: CSG problems with exported DMF Files |
|
|
Hi all,
for tests of my engine I have written a converter to make files of my own format from DMF Files created by deleDLite. For example I loaded Castlesiege and could render the exported model fine in my renderer.
Now I try to perform CSG with another self written tool on this data and found some bugs, which I could track down to the fact, that, that not all objects in the provided files are closed. For example, the "front wall" box iis not closed at the bottom.
My understanding is, that objects used for CSG MUST BE CLOSED and this explains the effects I see.
Deled itself also does a CSG when performing a lightmap calc. Now I ask myself, how this works...
My current idea is to "reconstruct" missing polygons to make brushes closed for the CSG, but I am not really happy with that....
Any ideas are appreciated,,
Thanks very much,
Herb |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Fri Mar 03, 2006 5:11 pm Post subject: |
|
|
Hi there Herbert,
In theory, objects must indeed be closed for CSG to work. But, this does not have to be the case in all situations. For example, if I create a cube in DeleD, remove its bottom polygon and the perform CSG Subtraction on it, it works perfectly. I can't think of a situation in which it wouldn't work at the moment, but I'm sure there are.
I'm not sure how your CSG routines work. I use a BSP-based algorithm myself. In your case, you either need to close objects yourself (which will be very easy with the upcoming DeleD 1.4) or write some tool to do that task automatically. I think the latter would be rather a difficult taks though. Besides that, even if the object is closed, there might also be polygons INSIDE the object, causing CSG routines to error out.
Btw, DeleD does not perform CSG when it is lightmapping the scene. |
|
Back to top |
|
|
herbert Member
Joined: 03 Mar 2006 Posts: 3
|
Posted: Fri Mar 03, 2006 5:42 pm Post subject: |
|
|
Hi Jeroen,
thanks for the fast reply. I try to perform CSG unions and use an algorithm based on the article by Stefan Hajnoczi (If I remember correctly, I found that on flipcode) about .MAP file loading. Currently I do not use a BSP based algorithm as you do, but in future I will do so.
I will try the way of closing the objects myself and test (my project primarily is to learn stuff).
Thanks again,
Herb |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Fri Mar 03, 2006 7:02 pm Post subject: |
|
|
No problem, keep us posted! |
|
Back to top |
|
|
Sindwiller DeleD PRO user
Joined: 25 May 2005 Posts: 331 Location: Zürich. Switzerland
|
Posted: Fri Mar 03, 2006 7:43 pm Post subject: |
|
|
Why you dont just release the sources of your tool under the GPL?
That was just a thought you know...
Wfr, Sindwiller _________________ "Ave Jeroen et Paul-Jan!" populus clamant. |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Fri Mar 03, 2006 9:19 pm Post subject: |
|
|
Who, me? |
|
Back to top |
|
|
Sindwiller DeleD PRO user
Joined: 25 May 2005 Posts: 331 Location: Zürich. Switzerland
|
Posted: Fri Mar 03, 2006 9:36 pm Post subject: |
|
|
No, i meant herbert. But you could release some things under the GPL... couldnt you?
Wfr, Sindwiller _________________ "Ave Jeroen et Paul-Jan!" populus clamant. |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sat Mar 04, 2006 1:56 pm Post subject: |
|
|
Nah, we are not that big fans of the GPL and other contagious license schemes. Any code we release (like the plugin sources, and perhaps other stuff in the future) will most likely be completely license free (or BSD-style-licensed at most). It's all just a matter of taste. |
|
Back to top |
|
|
herbert Member
Joined: 03 Mar 2006 Posts: 3
|
Posted: Sat Mar 04, 2006 3:54 pm Post subject: |
|
|
Andreas,
If you like, I could send you the interesting parts in my CSG code. You could get the code as is, it is far away from being finished and optimized. I will change a lot (e.g. using a BSP Tree approach) and I will not be able to answer questions.
Greetings,
Herb |
|
Back to top |
|
|
Sindwiller DeleD PRO user
Joined: 25 May 2005 Posts: 331 Location: Zürich. Switzerland
|
Posted: Sat Mar 04, 2006 9:19 pm Post subject: |
|
|
herbert,
you can send it to me but i cant use it for something. My programing skills are limited and at the moment, i dont have time to expand those. It was just an idea that if you release your sources on a open license (GPL, LGPL, Zlib, BSD-like) anyone could use your code and improve it.
Wfr, Sindwiller
ps. Like i can see, you have readed my blog _________________ "Ave Jeroen et Paul-Jan!" populus clamant. |
|
Back to top |
|
|
|