Bonjour,
je me suis mis Ã* l'opengl recemment pour le fenetrage et la gestion des evenements j'utilise Qt.
Lors de l'affichage l'image est tronqué voir image :
http://img87.imageshack.us/img87/6571/openglbr3.png

voila les principales fonctions:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 
void GlWidget::initializeGL()
{
	glEnable (GL_DEPTH_TEST);
	glEnable(GL_COLOR_MATERIAL);
}
 
void GlWidget::paintGL()
{
	glLoadIdentity();
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();
 
   	glRotatef(rotx, 1,0,0);
	glRotatef(roty, 0,1,0);
   	glTranslatef(x,y,z);
 
	// je dessine les axes
	glBegin(GL_LINES);	
		glColor3f(1,0,0);	
		glVertex3f(0,0,0);
		glVertex3f(0.5,0,0);
 
			glColor3f(0,1,0);	
			glVertex3f(0,0,0);
			glVertex3f(0,0.5,0);
 
		glColor3f(0,0,1);	
		glVertex3f(0,0,0);
		glVertex3f(0,0,0.5);
	glEnd();
 
	// je dessine la grille
	glColor3f(0.5,0.5,0.5);
  	glBegin(GL_LINES);
	for(int i=-taillegrille; i <= taillegrille ;i++) {
 
		glVertex3f((float)i, 0,-(float)taillegrille);
		glVertex3f((float)i, 0, (float)taillegrille);
		glVertex3f(-(float)taillegrille, 0,(float)i);
		glVertex3f( (float)taillegrille, 0,(float)i);
	}
	glEnd();
}
 
void GlWidget::resizeGL(int w, int h)
{	
	if(w<h)
	{
    	glViewport(0,(h-w)/2,w,w);
    	}
  	else{
    	glViewport((w-h)/2,0,h,h);
   }
}
Pour la fonction de gestion des evenements, je modifie les differentes variables x y z rotx ... et j'execute la fonction updateGl().

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
//creation du widget 
glWidget = new GlWidget();
glWidget->setFocusPolicy(Qt::WheelFocus);
glWidget->setMouseTracking(true);
 
//Main:
int main(int argc, char *argv[])
{
	QApplication app(argc, argv);
	Window window;
	window.resize(800, 600);
	window.show();
	return app.exec();
}
Je vois pas d'ou ca vient ...
Merci de m'aider
ps: je travaille sous linux avec QDevelop