View Full Version : Fragmentation

duran065

11-11-2003, 08:46 PM

Hi all !

I'm a student in computer science, and some days ago, my teacher tells me that I've to learn about fragmentation. But I don't know how to use it. there are some pages in the red book about it, but it's not explained really how to use it.

Frangmentation is well used for making union, intersection and substraction of objects.

Can anyone help me ?

Thx.

Adrien D.

Ysaneya

11-11-2003, 11:17 PM

Fragmentation ? In which context ?

I do not know any "fragmentation" in OpenGL.. what you seem to describe with unions/intersections/substractions is called CSG operations. I think these can be emulated with the stencil buffer in OpenGL. Is that what you want ?

Y.

AdrianD

11-12-2003, 01:38 AM

do you mean "tesselation" ?

duran065

11-12-2003, 01:47 AM

I'm sorry but i don't know exactly what it is... My teacher just explained me that it allows you to make an object which is the result of a substraction or union or intersection of two objects, like you do in mathematics.

Can you tell me more ???

Thx.

Google for "constructive solid geometry" or "boolean operations".

Here are two good links: http://www.cfxweb.net/~aggrav8d/tutorials/csg.html http://www.delphi3d.net/articles/viewarticle.php?article=csg.htm

Jan.

Don't Disturb

11-12-2003, 03:32 AM

That's Constructive Solid Geometry (CSG) which Ysaneya mentioned. Look it up in Google.

I don't know what fragmentation has got to do with it. The only mention of it in the Red Book that I can find refers to memory fragmentation, which isn't anything to do with what you describe.

duran065

11-12-2003, 06:39 AM

I think it's what he was looking for. Thank you very much ! It's very nice !

C ya soon !

duran065

11-18-2003, 08:41 PM

Hi ! It's me again !

In fact, what you've explained me was exactly what I was looking for.

But now, I need a ready-to-use sample of this csg method.

Is anybody knows where can I find such a sample ?

Thx.

Originally posted by duran065:

Is anybody knows where can I find such a sample ?

Thx.

try www.opencsg.org (http://www.opencsg.org)

duran065

11-24-2003, 05:50 AM

Thx, but it's not exactly what I'm looking for...

In the red book, chapter 11, it's written that :

"Given two or more polygons of the preceding form, CSG operations can be implemented as follows.

UNION - To calculate the union of several contours, draw all input contours as a single polygon. The winding number of each resulting region is the number of original polygons that cover it. The union can be extracted by using the GLU_TESS_WINDING_NONZERO or GLU_TESS_WINDING_POSITIVE winding rules. Note that with the nonzero winding rule, we would get the same result if all contour orientations were reversed.

INTERSECTION - This only works for two contours at a time. Draw a single polygon using two contours. Extract the result using GLU_TESS_WINDING_ABS_GEQ_TWO.

DIFFERENCE - Suppose you want to compute A diff (B union C union D). Draw a single polygon consisting of the unmodified contours from A, followed by the contours of B, C, and D, with their vertex order reversed. To extract the result, use the GLU_TESS_WINDING_POSITIVE winding rule. (If B, C, and D are the result of a GLU_TESS_BOUNDARY_ONLY operation, an alternative to reversing the vertex order is to use gluTessNormal() to reverse the sign of the supplied normal."

Is there any example of THAT (exactly that) on the Internet ? Can you help me please ?

Thx a lot !

[This message has been edited by duran065 (edited 11-24-2003).]

Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.