clipping plane acts strange

clipping plane acts strange

Post by Ivo Krooswij » Fri, 27 Jun 2003 01:34:56



hi, i have the following problem:

in my render function that draws everyting to the screen i also call my
clipping plane function.
everything that is rendered until that point may be partly deleted by this
plane.

this plane is always perpendicular on the xy-plane and in a certain angle
with the x-plane and the plane.
it exactly goes through the origin: see
http://www.krooswijk.com/downloads/clipping_plane.jpg
(i know z-axis and y-axis are  wrong because of  rotation around the x-axis
og -90)

this is my clipping plane function, concerning:  0<= angle_clipping_plane <=
360
___
RENDERING_ENGINE :: draw_clipping_plane( )
/*
 * Applies the clipping plane to the model
 */
{
 GLdouble clipping_plane[4] = { cos( angle_clipping_plane ), sin(
angle_clipping_plane ), 0.0, 0.0 };

 if( this->get_clipping_plane( ) )
 {
  glClipPlane( GL_CLIP_PLANE0, clipping_plane );
  glEnable( GL_CLIP_PLANE0 );
 }
 else
 {
  glDisable( GL_CLIP_PLANE0 );
 }

Quote:}

___

my two problems are:
- also the things rendered after applying the cutting plane are affected by
the plane
- when changing the angle clipping plane by one. the clipping does make an
angle of about 30 but never one.
does anyone know how this is possible.

tnx in advance

 
 
 

clipping plane acts strange

Post by Ralph Ker » Fri, 27 Jun 2003 20:14:10


Ivo Krooswijk schrieb:

Quote:

> my two problems are:
> - also the things rendered after applying the cutting plane are affected by
> the plane

any enabled clipping plane is applied on the geometry which is sent
_after_ enabling the clipping plane. Check out the times when
calling glEnable/glDisable(GL_CLIP_PLANE0).

Quote:> - when changing the angle clipping plane by one. the clipping does make an
> angle of about 30 but never one.
>  GLdouble clipping_plane[4] = { cos( angle_clipping_plane ), sin(
> angle_clipping_plane ), 0.0, 0.0 };

cos() and sin() take parameters in radian, not in degrees.
take cos(angle_clipping_plane*M_PI/180.0) ...

regards Ralph

 
 
 

clipping plane acts strange

Post by Ivo Krooswij » Fri, 27 Jun 2003 20:30:17


both solutions work great tnx!


Quote:> Ivo Krooswijk schrieb:

> > my two problems are:
> > - also the things rendered after applying the cutting plane are affected
by
> > the plane

> any enabled clipping plane is applied on the geometry which is sent
> _after_ enabling the clipping plane. Check out the times when
> calling glEnable/glDisable(GL_CLIP_PLANE0).

> > - when changing the angle clipping plane by one. the clipping does make
an
> > angle of about 30 but never one.
> >  GLdouble clipping_plane[4] = { cos( angle_clipping_plane ), sin(
> > angle_clipping_plane ), 0.0, 0.0 };

> cos() and sin() take parameters in radian, not in degrees.
> take cos(angle_clipping_plane*M_PI/180.0) ...

> regards Ralph

 
 
 

1. strange clip planes problems

Weird as it could be: if turning any of clipping planes (got 3 of them
in my program) X windows are crashing on one of my two Linux machines,
if turning some of them program is seg-faulting upon exit on other
machine. First machine has software rendering, second has i810 with
properly working hardware acceleration. On both machines RedHat 7.1 is
installed on both machines, X server is stock XFree86 4.0.3. Program
is using GLUT and GLUI for user interface, am also linking with
Freetype for font rendering. Most frustrating part is that everyting
works fine when first machine booted under Windows 2000 and program
compiled with Visual C++ 6. Any idea what might going on here?

Thanks.

2. flame/fire algorithm

3. WACOM acting strange

4. list of videocards and their hardware accelerated openGL functions

5. GLUT_KEY_UP and GLUT_KEY_DOWN acting strange

6. Problems with Ri Lighting calls

7. glNormalPointer & glShadeModel(GL_FLAT) acted strange together

8. GL_POINT mode acts strange

9. Portal clipping using HW clip-planes

10. Clipping polygon (clipping plane?)

11. Open Inventor/Menus in popup plane strange behavior

12. strange clipping -- probably a trivial newbie problem