CSG talk

Blitz3D Forums/Blitz3D Programming/CSG talk

Chroma(Posted 2006) [#1]
I've been pondering cube csg type stuff and it doesn't seem to be that difficult. Just working on the X axis atm....let's say there's a box with x1=-2 and x2=1. Then you drag a box where it's x1 lies inside the first box. Automatically you know that the box your dragging out's x1 is gonna become the first box's x2. Then you would not create the appropriate side on the box you're dragging out. That's not hard at all. The first box you interacted with, you could just destroy the appropriate wall and reconstruct it around the newly dragged box.

But, my question is...I wonder if maplet rooms had all welded vertices or if it just created a new plane in the appropriate place and added that surface to the appropriate mesh...and then rewelded the vertices or....


Chroma(Posted 2006) [#2]
So does anyone know if all the vertices in the maplet levels were welded?


Pepsi(Posted 2006) [#3]
I guess im confuse on what you mean by "welded"

For quite some time, I've been thinking about creating a CSG editor without the use of a BSP algorithm( Maplet uses a BSP algorithm for it's CSG if I remmember right). Anyways, It comes down to finding what polygons of the mesh are effected. Then you would have to recreate it with new polygons to create the combined mesh you want out of the CSG operation you've made.

When it comes down to "welding vertices", I think of multiple polygons sharing a similar vertex. If that is what you are thinking of, well ... think about how the uv cords of a specifc vertex would effect texturing of multiple polygons that share it. On paper, draw two squares side by side representing "walls". Map uv values for each point of one wall and then try to map uv values on the wall that's next to it. For a basic example... to have the same texture mapped to each wall looking the same, then the two vertex points that share the same location between the two walls cannot be welded( or be used by each wall ). I would not worry about welding vertices until the mesh was ready to be exported for use in a game.

I know decorator has a welding function to optimize the mesh, but my mind is not complicated enough yet to understand what conditions decorator uses to weld vertices togethor without effecting texturing.

Anyways, just my humble thoughts. Hopefully that helped some how and not totally useless. :)


Chroma(Posted 2006) [#4]
Coyote...wouldn't it be cool to make a simple csg modeler but only using the built in blitz3d primitives.

Check this code out. You can change the CreateCube() to any blitz3d primitive and it works well. If the csg function from the archives worked better, this could come together really fast with a ui by winblit3d.

Choose your primitive, choose the csg mode, a la maplet style. This would be a cool community project...but I don't have the time to coordinate it. =( I could definitely contribute to it tho.




Pepsi(Posted 2006) [#5]
.