IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Développement 2D, 3D et Jeux Discussion :

Problème de couleur sur une scène.


Sujet :

Développement 2D, 3D et Jeux

  1. #1
    Membre averti
    Homme Profil pro
    Inscrit en
    Novembre 2010
    Messages
    98
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations forums :
    Inscription : Novembre 2010
    Messages : 98
    Points : 402
    Points
    402
    Par défaut Problème de couleur sur une scène.
    Bonjour,
    j'ai une scene qui tournait en 32bits avec les toutes couleurs sur mes objets, apres avoir compliquer
    l'application sous 64bits, j'ai perdu toutes couleurs qui existaient sur mes objets.Je travail sous VS2010 c++.
    Je voudrais savoir comment pourais je retrouver les couleurs de mes objets sous 64bits.
    Merci

  2. #2
    Modérateur
    Avatar de wax78
    Homme Profil pro
    Chef programmeur
    Inscrit en
    Août 2006
    Messages
    4 084
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Belgique

    Informations professionnelles :
    Activité : Chef programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 4 084
    Points : 7 996
    Points
    7 996
    Par défaut
    Cela ne serait pas plus mal si tu disais de quoi tu parles ?

    Quelle bibliothèque utilises tu, format de fichier des objets etc ....

  3. #3
    Membre averti
    Homme Profil pro
    Inscrit en
    Novembre 2010
    Messages
    98
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations forums :
    Inscription : Novembre 2010
    Messages : 98
    Points : 402
    Points
    402
    Par défaut
    oui! tu as parfaitement raison wax78,
    J'utilise la bibliothèque OpenGL avec une scène 3D,je travail sous VS 2010 express. Je génère des objets sous forment de polyèdres.

  4. #4
    Membre averti
    Homme Profil pro
    Inscrit en
    Novembre 2010
    Messages
    98
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations forums :
    Inscription : Novembre 2010
    Messages : 98
    Points : 402
    Points
    402
    Par défaut
    Le code OpenGl que j'utilise pour ma scène ce présente comme ce ceux-ci
    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
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
     
    void setupPixelFormat(HDC hDC) 
    {   
    	PIXELFORMATDESCRIPTOR pfd =  
    		{   
    		  sizeof(PIXELFORMATDESCRIPTOR),  //taille du descripteur de format 
    				1, //version 
    				PFD_SUPPORT_OPENGL |
    				PFD_DRAW_TO_WINDOW | 
    				PFD_DOUBLEBUFFER, //Propriétés 
    				PFD_TYPE_RGBA,  //Mode de couleurs 
    				16,  //Bits de couleur 
    				0, 0, 0, 0, 0, 0, //Paramètres des couleurs 
    				0,0,  //Paramètres alpha 
    				0,0, 0, 0, 0, //Paramètres du buffer d'accumulation 
    				32, //Bits de profondeur 
    				0,  //Bits du buffer stencil  
    				0,  //Nombre de buffers auxiliaires 
    				0,  //ignoré (obsolète) 
    				0,  //réservé 
    				0,  //ignoré (obsolète) 
    				0, //Couleur de transparence 
    				0  //Ignoré (obsolète) 
    		 };   
     
    	int pixelFormat;  
    	pixelFormat = ChoosePixelFormat(hDC, &pfd);  
    	if (!pixelFormat)  
    	{  
     
    	  MessageBox(WindowFromDC(hDC),
    			"Mode graphique non supporté.",
    			"Problème",
    			MB_ICONERROR | MB_OK);
    		exit(1);
    	}    
    	if (!SetPixelFormat(hDC, pixelFormat, &pfd))  
    	{     
    	  MessageBox(WindowFromDC(hDC),"Mode graphique non supporté.",
    				"Problème",	MB_ICONERROR | MB_OK);
    		exit(1);
    	}   
    }
     
    void initgl (void)
    {
     
     
    	GLfloat light0_pos[4]   = { 0.5f, 0.5f, 0.5f, 0.0f };
    	GLfloat light0_color[4] = { .6f, .6f, .6f, 1.0f }; //* lumière blanche
     
    	GLfloat light1_pos[4]   = { 50.0f, 50.0f, -50.0f, 0.0f };
    	GLfloat light1_color[4] = { .6f, .6f, .6f, 1.0f }; //* lumière blanche
     
    	GLfloat light2_pos[4]   = { -50.0f, 0.5f, 0.5f, 0.0f };
    	GLfloat light2_color[4] = { .6f, .6f, .6f, 1.0f }; //* lumière blanche
     
    	GLfloat light3_pos[4]   = { 50.0f, 50.0f, -50.0f, 0.0f };
    	GLfloat light3_color[4] = { .6f, .6f, .6f, 1.0f }; //* lumière blanche
     
    	GLfloat light4_pos[4]   = { 0.5f, 0.5f, 0.5f, 0.0f };
    	GLfloat light4_color[4] = { .6f, .6f, .6f, 1.0f }; //* lumière blanche
     
    	GLfloat light5_pos[4]   = { 50.0f, 50.0f, -50.0f, 0.0f };
    	GLfloat light5_color[4] = { .6f, .6f, .6f, 1.0f }; //* lumière blanche
     
    	GLfloat light6_pos[4]   = { 50.0f, 50.0f, 50.0f, 0.0f };
    	GLfloat light6_color[4] = { .6f, .6f, .6f, 1.0f }; //* lumière blanche
     
     
    	//* remove back faces 
    	glDisable(GL_CULL_FACE);
    	glEnable(GL_DEPTH_TEST);
     
    	//* speedups 
    	glEnable(GL_DITHER);
    	glShadeModel(GL_SMOOTH);
    	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
    	glHint(GL_POLYGON_SMOOTH_HINT, GL_FASTEST);
     
    	//* lumières *
    	glLightfv(GL_LIGHT0, GL_POSITION, light0_pos);
    	glLightfv(GL_LIGHT0, GL_DIFFUSE,  light0_color);
    	glEnable(GL_LIGHT0);
     
    	glLightfv(GL_LIGHT1, GL_POSITION, light1_pos);
    	glLightfv(GL_LIGHT1, GL_DIFFUSE,  light1_color);
    	glEnable(GL_LIGHT1);
     
    	glLightfv(GL_LIGHT2, GL_POSITION, light2_pos);
    	glLightfv(GL_LIGHT2, GL_DIFFUSE,  light2_color);
    	glEnable(GL_LIGHT2);
     
    	glLightfv(GL_LIGHT3, GL_POSITION, light3_pos);
    	glLightfv(GL_LIGHT3, GL_DIFFUSE,  light3_color);
     
    	glLightfv(GL_LIGHT4, GL_POSITION, light4_pos);
    	glLightfv(GL_LIGHT4, GL_DIFFUSE,  light4_color);
     
    	glLightfv(GL_LIGHT5, GL_POSITION, light5_pos);
    	glLightfv(GL_LIGHT5, GL_DIFFUSE,  light5_color);
     
     
    	glLightfv(GL_LIGHT6, GL_POSITION, light6_pos);
    	glLightfv(GL_LIGHT6, GL_DIFFUSE,  light6_color);
     
     
    	glEnable(GL_LIGHTING);
     
    	glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE);
    	glEnable(GL_COLOR_MATERIAL);
     
     
     
    } 
     
    void draw_axes( float scale )
    {
    	glDisable( GL_LIGHTING );
     
    	glPushMatrix();
    	glScalef( scale, scale, scale );
     
     
    	glLineWidth(2);
     
    	glBegin( GL_LINES );
     
    	glColor3f( 1, 0, 0 );
    	glVertex3f( .8f, -0.05f, 0 );  glVertex3f( 1, -0.25f, 0 ); //* Letter X 
    	glVertex3f( 0.8f, -0.25f, 0 );  glVertex3f( 1, -0.05f, 0 );
    	glVertex3f( 0, 0, 0 );  glVertex3f( 1, 0, 0 ); //* X axis      
     
    	glColor3f( 0, 1, 0);
    	glVertex3f( -.25f, 0.8f, 0 );  glVertex3f( -.05f, 1, 0 ); //* Letter Y 
    	glVertex3f( -.25f, 1, 0 );  glVertex3f( -.15f, 0.9f, 0 );
    	glVertex3f( 0, 0, 0 );  glVertex3f( 0, 1, 0 ); //* Y axis
     
     
     
     
    	if (info_valeur(58) > 20)
    	{
    		glColor3f( 0, 0, 1 );
    		glVertex3f( 0, 0, 0 );  glVertex3f( 0.0f, 0.0f, 1.0f ); //* Z axis
    		//Ici je place la lettre Z sur l'axe Z
    		glVertex3f( -0.1f, 0, 0.8f);	glVertex3f( -0.3f, 0, 0.8f);
    		glVertex3f( -0.1f, 0.2f, 0.8f);	glVertex3f( -0.3f, 0, 0.8f);
    		glVertex3f( -0.1f, 0.2f, 0.8f);	glVertex3f( -0.3f, 0.2f, 0.8f);
    	}
    	glEnd();
     
    	glLineWidth(1);
     
    	glPopMatrix();
     
    	glEnable( GL_LIGHTING );
    }
     
    void draw_axesXY( float scale )
    {
    	glDisable( GL_LIGHTING );
     
    	glPushMatrix();
    	glScalef( scale, scale, scale );
     
     
    	glLineWidth(2);
     
    	glBegin( GL_LINES );
     
    	glColor3f( 1, 0, 0 );
    	glVertex3f( .8f, -0.05f, 0 );  glVertex3f( 1, -0.25f, 0 ); //* Letter X 
    	glVertex3f( 0.8f, -0.25f, 0 );  glVertex3f( 1, -0.05f, 0 );
    	glVertex3f( 0, 0, 0 );  glVertex3f( 1, 0, 0 ); //* X axis      
     
    	glColor3f( 0, 1, 0);
    	glVertex3f( -.25f, 0.8f, 0 );  glVertex3f( -.05f, 1, 0 ); //* Letter Y 
    	glVertex3f( -.25f, 1, 0 );  glVertex3f( -.15f, 0.9f, 0 );
    	glVertex3f( 0, 0, 0 );  glVertex3f( 0, 1, 0 ); //* Y axis
     
    		//glColor3f ( GetBValue(info->couleur_conteneur)/255.0f, GetGValue(info->couleur_conteneur)/255.0f,0);
     
    		if (info_valeur(58) > 20)
    	{
    		glColor3f( 255, 255, 255 );
    		glVertex3f( 0, 0, 0 );  glVertex3f( 0.0f, 0.0f, 1.0f ); //* Z axis
    		//Ici je place la lettre Z sur l'axe Z
    		glVertex3f( -0.1f, 0, 0.8f);	glVertex3f( -0.3f, 0, 0.8f);
    		glVertex3f( -0.1f, 0.2f, 0.8f);	glVertex3f( -0.3f, 0, 0.8f);
    		glVertex3f( -0.1f, 0.2f, 0.8f);	glVertex3f( -0.3f, 0.2f, 0.8f);
    	}
    	glEnd();
     
    	glLineWidth(1);
     
    	glPopMatrix();
     
    	glEnable( GL_LIGHTING );
    }
     
    void draw_axesYZ( float scale )
    {
    	glDisable( GL_LIGHTING );
     
    	glPushMatrix();
    	glScalef( scale, scale, scale );
     
     
    	glLineWidth(2);
     
    	glBegin( GL_LINES );
     
    	glColor3f( 0, 0, 1 );
    	glVertex3f( 1, -0.25f, 0);	glVertex3f( 0.8f, -0.25f, 0);
    	glVertex3f( 1, -0.05f, 0);	glVertex3f( 0.8f, -0.25f, 0);
    	glVertex3f( 1, -0.05f, 0);	glVertex3f( 0.8f, -0.05f, 0);
    	glVertex3f( 0, 0, 0 );  glVertex3f( 1, 0, 0 ); //* X axis      
     
    glColor3f( 0, 1, 0);
    	glVertex3f( -.25f, 0.8f, 0 );  glVertex3f( -.05f, 1, 0 ); //* Letter Y 
    	glVertex3f( -.25f, 1, 0 );  glVertex3f( -.15f, 0.9f, 0 );
    	glVertex3f( 0, 0, 0 );  glVertex3f( 0, 1, 0 ); //* Y axis
     
    		//glColor3f ( GetBValue(info->couleur_conteneur)/255.0f, GetGValue(info->couleur_conteneur)/255.0f,0);
     
    		if (info_valeur(58) > 20)
    	{
    		glColor3f( 255, 255, 255 );
    		glVertex3f( 0, 0, 0 );  glVertex3f( 0.0f, 0.0f, 1.0f ); //* Z axis
    		//Ici je place la lettre Z sur l'axe Z
    		glVertex3f( -0.1f, 0, 0.8f);	glVertex3f( -0.3f, 0, 0.8f);
    		glVertex3f( -0.1f, 0.2f, 0.8f);	glVertex3f( -0.3f, 0, 0.8f);
    		glVertex3f( -0.1f, 0.2f, 0.8f);	glVertex3f( -0.3f, 0.2f, 0.8f);
    	}
    	glEnd();
     
    	glLineWidth(1);
     
    	glPopMatrix();
     
    	glEnable( GL_LIGHTING );
    }
     
     
     
    void draw_axesXZ( float scale )
    {
    	glDisable( GL_LIGHTING );
     
    	glPushMatrix();
    	glScalef( scale, scale, scale );
     
     
    	glLineWidth(2);
     
    	glBegin( GL_LINES );
     
    	glColor3f( 1, 0, 0 );
    	glVertex3f( .8f, -0.05f, 0 );  glVertex3f( 1, -0.25f, 0 ); //* Letter X 
    	glVertex3f( 0.8f, -0.25f, 0 );  glVertex3f( 1, -0.05f, 0 );
    	glVertex3f( 0, 0, 0 );  glVertex3f( 1, 0, 0 ); //* X axis      
     
    	glColor3f( 0, 0, 1 );
    	glVertex3f( -0.2f, 1, 0);	glVertex3f( -0.4f, 1, 0);
    	glVertex3f( -0.2f, 1, 0);	glVertex3f( -0.4f, 0.8f, 0);
    	glVertex3f( -0.2f, 0.8f, 0);	glVertex3f( -0.4f, 0.8f, 0);
    	glVertex3f( 0, 0, 0 );  glVertex3f( 0, 1, 0 ); //* Y axis
     
    		//glColor3f ( GetBValue(info->couleur_conteneur)/255.0f, GetGValue(info->couleur_conteneur)/255.0f,0);
    	if (info_valeur(58) > 20)
    	{
    		glColor3f( 255, 255, 255 );
    		glVertex3f( 0, 0, 0 );  glVertex3f( 0.0f, 0.0f, 1.0f ); //* Z axis
    		//Ici je place la lettre Z sur l'axe Z
    		glVertex3f( -0.1f, 0, 0.8f);	glVertex3f( -0.3f, 0, 0.8f);
    		glVertex3f( -0.1f, 0.2f, 0.8f);	glVertex3f( -0.3f, 0, 0.8f);
    		glVertex3f( -0.1f, 0.2f, 0.8f);	glVertex3f( -0.3f, 0.2f, 0.8f);
    	}
     
     
    	glEnd();
     
    	glLineWidth(1);
     
    	glPopMatrix();
     
    	glEnable( GL_LIGHTING );
    }
    merci

  5. #5
    Modérateur
    Avatar de wax78
    Homme Profil pro
    Chef programmeur
    Inscrit en
    Août 2006
    Messages
    4 084
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Belgique

    Informations professionnelles :
    Activité : Chef programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 4 084
    Points : 7 996
    Points
    7 996
    Par défaut
    Et donc si je ne me trompe pas, tu n'as utiliser que des GlVertex et des GlColor pour simplifier un peu ? (je veux dire, pas de textures ou autres joyeusete).

  6. #6
    Membre averti
    Homme Profil pro
    Inscrit en
    Novembre 2010
    Messages
    98
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations forums :
    Inscription : Novembre 2010
    Messages : 98
    Points : 402
    Points
    402
    Par défaut
    non, je n'ai mis que c'est 2 jusque la! la texture , je lai commencer mais pas terminer, car on met la pression de revoir la forme de mes polyèdres afin que ca soit plus ronde et juge le faite qu'il y ai la couleur c'est déjà pas mal.Une fois terminer avec la forme de mes polyèdres que j'y compte revenir la dessus.
    Actuellement , j'aimerais savoir pourquoi la couleur est partie et es ce qu'il est possible que puisse le ramener.

  7. #7
    Membre averti
    Homme Profil pro
    Inscrit en
    Novembre 2010
    Messages
    98
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations forums :
    Inscription : Novembre 2010
    Messages : 98
    Points : 402
    Points
    402
    Par défaut
    wax78, actuellement j'aimerais savoir pourquoi la couleur est partie et comment le ramener!

  8. #8
    Responsable 2D/3D/Jeux


    Avatar de LittleWhite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2008
    Messages
    26 894
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 26 894
    Points : 219 533
    Points
    219 533
    Billets dans le blog
    124
    Par défaut
    Bonjour,

    Pensez à bien désactiver les textures et faire aussi en sorte qu'il y ai bien la couleur effective sur les matériaux (voir NeHe 6 / 7 et celui des display list )

  9. #9
    Membre averti
    Homme Profil pro
    Inscrit en
    Novembre 2010
    Messages
    98
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations forums :
    Inscription : Novembre 2010
    Messages : 98
    Points : 402
    Points
    402
    Par défaut
    ok, merci LittleWhite.

  10. #10
    Membre averti
    Homme Profil pro
    Inscrit en
    Novembre 2010
    Messages
    98
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations forums :
    Inscription : Novembre 2010
    Messages : 98
    Points : 402
    Points
    402
    Par défaut
    Merci a toi LittleWhite pour ces documents qui mon vraiment été nécessaire,
    j'ai aussi trouver un document qui m'a vraiment lancer ausi

    http://www.ann.jussieu.fr/hecht/ftp/DEA/OpenGL.pdf

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problème de performance sur une "grosse" BD
    Par frechy dans le forum Installation
    Réponses: 9
    Dernier message: 19/09/2005, 16h52
  2. Réponses: 4
    Dernier message: 16/06/2005, 15h37
  3. Problème de select sur une date (DATETIME....)
    Par zeldoi5 dans le forum Langage SQL
    Réponses: 7
    Dernier message: 16/05/2005, 11h19
  4. probléme de cadre sur une image qui me sert de lien
    Par thomas_chamas dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 26/11/2004, 17h36
  5. Problème de chaine sur une page HTML
    Par Kerod dans le forum Général JavaScript
    Réponses: 8
    Dernier message: 23/11/2004, 16h23

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo