Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get the clip plane intersection vertices

21 views
Skip to first unread message

Binoy

unread,
Feb 5, 2004, 9:09:48 PM2/5/04
to
Hello everybody,

If I clip a solid/wireframe model against a front/user-defined
orthogonal clipping plane positioned along one of axis, the clipped
polygons are getting drawn as broken lines, i.e. the intersection
lines with the clipping plane are not drawn continuously.
Is there a way to make OI/OpenGL draw closed lines, i.e. draw the
intersection contour as continuous lines where the polygons intersect
the clipping plane?

I guess this happens when there are polygons whose normal are
perpendicular to the view direction (i.e. when I look at the polygons
exactly from the side) and therefore nothing is visible as OI/OpenGL
assume that polygons have no thickness.

If that's the case, is there a way to get those intersection points
back from Open Inventor, so that I can manually draw the intersection
as line segments.

I saw an example in the following reference page for
"SoClipPlaneManip" that seem to draw the intersection as line segments
as well as highlight the vertices involved. And that example program
seems to save the cut section/contour out as well. How does it do it?
If any one here can explain it to me, it will be of great help.

http://doc.coin3d.org/Coin/classSoClipPlaneManip.html

Thanks,
-Binoy

Lars J

unread,
Feb 6, 2004, 10:29:51 AM2/6/04
to
In article <a914d8b.04020...@posting.google.com>,

The example you see on that page uses the SoClipPlaneManip just cut
the jetplane off with a plane. It then uses a callback-action to get
all the triangles in the scene (setTriangleCallback()) and intersects
them against the same clipping plane to get the line pieces of the cut.
I used the SbClip class in Coin for this.

The random line pieces were then organized into loops. Where two lines
continue in the same direction, the two lines are joined into one instead
to get rid of uninteresting vertices. Then an SoIndexedLineSet is created
to render the loops, and an SoMarkerSet is used to mark the vertex
positions. This geometry is placed behind the separator that contains
the clipplanemanip and the jetplane so it is not affected by the
clipping.

Regards,

Lars J

Binoy

unread,
Feb 6, 2004, 3:24:21 PM2/6/04
to
la...@frey.trh.sim.no (Lars J) wrote in message news:<c00btf$ru8$1...@news.tdcnorge.no>...

Thanks a lot for this solution. As I am not very comfortable with
Coin3D, let me know whether this example come part of the Coin3D
samples? I would appreciate if you can point me to the source code.

Thanks

-Binoy
> Regards,
>
> Lars J

Lars J

unread,
Feb 9, 2004, 8:10:23 AM2/9/04
to
In article <a914d8b.04020...@posting.google.com>,
Binoy <bi...@marvar.com> wrote:
> la...@frey.trh.sim.no (Lars J) wrote in message
> news:<c00btf$ru8$1...@news.tdcnorge.no>...
> > The example you see on that page uses the SoClipPlaneManip just cut
> > the jetplane off with a plane. It then uses a callback-action to get
> > all the triangles in the scene (setTriangleCallback()) and intersects
> > them against the same clipping plane to get the line pieces of the cut.
> > I used the SbClip class in Coin for this.
> >
> > The random line pieces were then organized into loops. Where two lines

Strings, actually, not loops. Had to check if the string was a loop when
removing superfluous vertices though.

> > continue in the same direction, the two lines are joined into one instead
> > to get rid of uninteresting vertices. Then an SoIndexedLineSet is created
> > to render the loops, and an SoMarkerSet is used to mark the vertex
> > positions. This geometry is placed behind the separator that contains
> > the clipplanemanip and the jetplane so it is not affected by the
> > clipping.
>
> Thanks a lot for this solution. As I am not very comfortable with
> Coin3D, let me know whether this example come part of the Coin3D
> samples? I would appreciate if you can point me to the source code.

The code was developed for an external contractor, so it's not our own
intellectual property. I'll do a quick check on what can be done with
the code, but I doubt anything comes of it...

Lars J

Binoy

unread,
Feb 9, 2004, 2:46:22 PM2/9/04
to
la...@frey.trh.sim.no (Lars J) wrote in message news:<c080rv$lp7$1...@news.tdcnorge.no>...

Thanks Lars!, in the mean time let me try and write down the code the
way I understood it.

-Binoy
> Lars J

Lars J

unread,
Feb 10, 2004, 5:53:48 AM2/10/04
to
In article <a914d8b.04020...@posting.google.com>,
Binoy <bi...@marvar.com> wrote:
> la...@frey.trh.sim.no (Lars J) wrote in message
> news:<c080rv$lp7$1...@news.tdcnorge.no>...

> > The code was developed for an external contractor, so it's not our own
> > intellectual property. I'll do a quick check on what can be done with
> > the code, but I doubt anything comes of it...
>
> Thanks Lars!, in the mean time let me try and write down the code the
> way I understood it.

All the code are belong to us ;), it turns out, so I'll make an example out
of it. I just don't have the time to do it right now...

Lars J

Binoy

unread,
Feb 20, 2004, 9:40:33 PM2/20/04
to
la...@frey.trh.sim.no (Lars J) wrote in message news:<c0ad7s$762$1...@news.tdcnorge.no>...

Hello Lars,

Thanks a lot for the help!

0 new messages