Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Boolean Operations on Objects

Author
Message
Firesea
23
Years of Service
User Offline
Joined: 7th Apr 2003
Location:
Posted: 11th Apr 2003 19:30
Anyone tried or willing to share code for boolean operators on objects? Even though they're not true "closed" objects, how about boolean operators on meshes?

Even pseudo code would be helpful

Thank you
Firesea
Firesea
23
Years of Service
User Offline
Joined: 7th Apr 2003
Location:
Posted: 11th Apr 2003 19:57
Read a few of the old posts - slight clarification:

Boolean - I want to combine objects and/or meshes into a single new object or mesh.

Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 11th Apr 2003 21:37
this is by no mean feat a simple task to accomplish...
if you want understand how hard this is, try and subract or union a complex object with 3DStudio Max5 - they just don't do it right, especially on subtraction.

the way to go about it though is thinking about it in the simplist of terms - in other words, of you want to unite objects - you take all the point of Object B (combiner object) and then you cross check what vertex are withing the structure of Object A (target object) ... you then find which ones are the closest inside and closest outside the object... Save these for points of referance!

delete the rest which are internal (i'd suggest a boolean mark to tell the engine which to cull and which not to).
Next you do and interpolation movement between each of the Vertex which are marked for just inside and just outside ... you check for the 2 closest to each other only and then move the one inside to the intepolled point which collides with the surface approximation you've taken from the object your putting it in.

finally you strip ALL of the faces from the object and rebuild them from all of the vertex available
this may screw up the UV mapping, but it boolean operates correctly even on the most complex objects. Remember the face you use for calculating the interpol point is the nearest one on Object A which will involve 3 Vertex meaning you'll have to cross Product the offset points to get the position.

i currently have a DLL for achieving this kinda things, but its not setup for DarkBasic Mesh use yet - and with the FVF format it makes it ALOT harder to do these kinda things, because you don't strip faces you have to reorder the entire bloody vertex data to create the faces in the right order. its insane really.

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 11th Apr 2003 22:12
Firesea,

Not quite sure that I understand you.

But, if you want to combine objects or meshes, create the main "parent" object, then use ADD LIMB to add new limbs to objects which are created from meshes.

Meshes are loaded in via LOAD MESH.

To combine objects in, use MAKE MESH FROM OBJECT to make the mesh then add it as a limb to the parent object.

Current Project: Retro Compo. Entry.

Login to post a reply

Server time is: 2026-07-11 12:01:44
Your offset time is: 2026-07-11 12:01:44