Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2944 connectés 

  FORUM HardWare.fr
  Programmation

  [open gl] please j'ai un problème avec glortho

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[open gl] please j'ai un problème avec glortho

n°165544
airseb
Posté le 25-06-2002 à 15:58:29  profilanswer
 

le cube que je veux faire n'a pas la profondeur souhaitée, mais en changeant les valeurs de glortho on l'obtient. Pouvez vous m'expliquer comment trouver les bonnes valeurs ?
 
voici le programme :
 
#include <GL/glut.h>
#include <stdlib.h>
 
 
void display (void)  
{
 
 
static GLint vertices [] = {1,1,0,  10,1,0, 10,10,0, 1,10,0, -2,8,10,  7,8,10,  
         7,17,10, -2,17,10};
 
static GLfloat colors_RGB [] = {1.0,0.2,0.2,  0.2,0.2,1.0,  0.8,1.0,0.2,  0.75,0.75,0.75,
   0.35,0.35,0.35,  0.5,0.5,0.5};
 
glEnableClientState (GL_COLOR_ARRAY);
glEnableClientState (GL_VERTEX_ARRAY);
glColorPointer (3, GL_FLOAT, 0, colors_RGB);
glVertexPointer (3, GL_INT, 0, vertices);
 
static GLubyte toutLesSommets [] = { 0,1,2,3, 4,0,3,7, 5,1,2,6, 4,0,1,5, 7,3,2,6, 4,7,6,5};
 
glPolygonMode (GL_FRONT , GL_FILL) ;
glFrontFace (GL_CCW) ;
glEnable (GL_CULL_FACE) ;
  glCullFace (GL_BACK) ;
 
glDrawElements (GL_QUADS, 24, GL_UNSIGNED_BYTE, toutLesSommets) ;
 
glutSwapBuffers() ;
glFlush () ;
}
 
void main (int argc, char** argv)
 
{
glutInit (&argc, argv) ;
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) ;
glutInitWindowSize (640, 480) ;
glutInitWindowPosition (250,250) ;
glutCreateWindow (argv [0]) ;
 
glClearColor (1.0, 1.0, 1.0, 1.0) ;
glClear (GL_COLOR_BUFFER_BIT) ;
 
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
 
glOrtho (-5.0, 16.0, -5.0, 16.0, -1.0, 16.0) ;
 
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
 
glutDisplayFunc (display) ;
glutMainLoop () ;
 
}


Message édité par airseb le 25-06-2002 à 16:30:16
mood
Publicité
Posté le 25-06-2002 à 15:58:29  profilanswer
 

n°165577
airseb
Posté le 25-06-2002 à 16:30:27  profilanswer
 

up :ouch:

n°165680
airseb
Posté le 25-06-2002 à 17:45:19  profilanswer
 

up :D

n°165780
youdontcar​e
Posté le 25-06-2002 à 19:37:04  profilanswer
 

hmmm ... :D
 
http://www.google.com/search?q=glortho
 
ce qu'il te faut, c'est un tutorial sur les transformations world / view / projection. pour commencer :
 
http://www.opengl.org/developers/code/s2001/OpenGL.ppt
 
par ex.


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation

  [open gl] please j'ai un problème avec glortho

 

Sujets relatifs
[VB] problème de sauvegarde VB6...[open gl] pourquoi mon programme marche pas ??? (tjs pas 2)
[SQL] Problème dans une requete Edit : résolu[PHP] Problème de Parsing :(((
[JAVA/RESEAUX] pinger / Problème avec les fluxProbleme avec GDK
problème de combobox[C] Probleme avec un free ....
Probleme de code !Probleme de comparaison .....
Plus de sujets relatifs à : [open gl] please j'ai un problème avec glortho


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR