i'm actually use the "hardware method", with two clips
planes
in fact the front clip and the back clip of a camera
locate just on the cut plane.
works only with parallel projection
(see my code bellow)

but the result is not very nice
the cross section obtained is a dotted line...
there are some gaps in the cross - section
i join also the response of Mark Hood when i submit
the problem to the list.

If anyone have a better solution or any tricks to
improve my cross section,i will be interested.

regards

Renaud

the response of Mark Hood from Sun (june 2002) :
The front and back clip planes are not really intended
to solve this
sort of
problem (generating polygonal cross-sections).  This
clipping is done
in
hardware and is very system-dependent (although I am
able to see the
same
result as you).  It involves how the hardware triangle
rasterizer is
implemented.

Triangles really have no depth; mathematically they
are infinitely
thin.
Usually viewing a complete triangle edge-on will cause
it to disappear
unless
special edge attributes are applied.  Clipping away
the front and back
in an
attempt to get a single pixel depth will mostly result
in undefined
behavior.
You'll notice that the gaps are most prominent when
the cylinder faces
are
edge-on to the camera.

This problem is probably best solved mathematically.
-----------------------------------------------


my code :

Transform3D location = new Transform3D();
location.set(new Vector3f(.0f,.0f,.0f));
cameraD_.setlocation(location);

cameraD_. ... .setViewPlatformBehavior(orbitBehavior);

cameraD_. ..
.setProjectionPolicy(View.PARALLEL_PROJECTION);
cameraD_. ... .setBackClipDistance(0.0008);
cameraD_. ... .setFrontClipDistance(0.00);

//the cut plane
Box BoxObj = new Box(3f, 3f, 0.01f, ap2);
PlatformGeometry pg = new PlatformGeometry();

Transform3D translation = new Transform3D();
translation.setTranslation(new
Vector3f(0.0f,0.0f,-0.001f));
TransformGroup translate = new TransformGroup();
translate.setTransform(translation);
translate.addChild(BoxObj);
pg.addChild(translate);

cameraD_. ... .setPlatformGeometry(pg);


 --- "Raj N. Vaidya" <[EMAIL PROTECTED]> a écrit :
> Well, a couple of ways that I could think of....
>
> In software, you can generate a contour line through
> the elements of
> your GeometryArray - tris/quads. The contour line is
> the locus of points
> where the signed normal distance of the vertices
> from the cutting plane
> is equal to zero. In the case of a sphere, you will
> get a circle - possibly
> a great circle depending upon where you cut the
> sphere.
>
> In "hardware", I think you may be able to use 2
> appropriately
> oriented parallel ModelClip planes to achieve the
> effect. This would
> produce a ring actually, but if the distance between
> the clip planes is
> small enough it will look like a line contour.
> Haven't tried it,
> but looks like it would work.
>
>
> Regards
>
> Vaidya
>
>
> >On Wed, 9 Oct 2002 07:50:48 -0700, Scholl, Ed
> <[EMAIL PROTECTED]> wrote:
>
> >Hello-
> >Can anyone give me some pointers to draw the 2D
> outline obtained from the
> >intersection of a cutting plane with my 3D world?
> i.e. if I specify a
> >cutting plane that intersects with a sphere, I want
> to display the resulting
> >circle.
> >
> >-Ed
> >
> >
>
==========================================================================


___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to