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
| void drawVoiture (GLuint *texture)
{
//LoadGLTextures();
glColor3ub(255,255,115);
glBindTexture(GL_TEXTURE_2D, texture[2]);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glMatrixMode(GL_TEXTURE);
//glLoadIdentity();
//glScalef(2,2,2);
glEnable(GL_TEXTURE_2D);
glBegin (GL_QUADS);
glVertex3f (-0.1,1.8,0.16); //barbrise
glVertex3f (-0.5,1.8,0.16);
glVertex3f (-0.5,2,0.33);
glVertex3f (-0.1,2,0.33);
glVertex3f (-0.1,2,0.33); //capot
glVertex3f (-0.5,2,0.33);
glVertex3f (-0.5,2.3,0.36);
glVertex3f (-0.1,2.3,0.36);
glVertex3f (-0.1,2.3,0.36); //verre avant
glVertex3f (-0.5,2.3,0.36);
glVertex3f (-0.5,2.4,0.53);
glVertex3f (-0.1,2.4,0.53);
glVertex3f (-0.1,2.4,0.53); //sol haut
glVertex3f (-0.5,2.4,0.53);
glVertex3f (-0.5,2.9,0.53);
glVertex3f (-0.1,2.9,0.53);
glTexCoord2i(0,1); glVertex3f (-0.1,2.9,0.53); //arriere
glTexCoord2i(1,1); glVertex3f (-0.5,2.9,0.53);
glTexCoord2i(1,0); glVertex3f (-0.5,3.1,0.16);
glTexCoord2i(0,0); glVertex3f (-0.1,3.1,0.16);
glVertex3f (-0.5,3.1,0.16); //bas
glVertex3f (-0.1,3.1,0.16);
glVertex3f (-0.1,2.95,0.16);
glVertex3f (-0.5,2.95,0.16);
glVertex3f (-0.1,2.95,0.16); //pour permettre les pneux arrieres
glVertex3f (-0.5,2.95,0.16);
glVertex3f (-0.1,2.93,0.24);
glVertex3f (-0.5,2.93,0.24);
glVertex3f (-0.1,2.93,0.24); //pour permettre les pneux arrieres
glVertex3f (-0.5,2.93,0.24);
glVertex3f (-0.1,2.71,0.24);
glVertex3f (-0.5,2.71,0.24);
glVertex3f (-0.1,2.71,0.24); //pour permettre les pneux arrieres
glVertex3f (-0.5,2.71,0.24);
glVertex3f (-0.1,2.69,0.16);
glVertex3f (-0.5,2.69,0.16);
glVertex3f (-0.1,2.69,0.16); //bas
glVertex3f (-0.5,2.69,0.16);
glVertex3f (-0.5,2.22,0.16);
glVertex3f (-0.1,2.22,0.16);
glVertex3f (-0.1,2.22,0.16); //pour permettre les pneux avant
glVertex3f (-0.5,2.22,0.16);
glVertex3f (-0.5,2.2,0.24);
glVertex3f (-0.1,2.2,0.24);
glVertex3f (-0.5,2.2,0.24); //pour permettre les pneux avant
glVertex3f (-0.1,2.2,0.24);
glVertex3f (-0.1,1.98,0.24);
glVertex3f (-0.5,1.98,0.24);
glVertex3f (-0.1,1.98,0.24); //pour permettre les pneux avant
glVertex3f (-0.5,1.98,0.24);
glVertex3f (-0.5,1.96,0.16);
glVertex3f (-0.1,1.96,0.16);
glVertex3f (-0.5,1.96,0.16); //pour permettre les pneux avant
glVertex3f (-0.1,1.96,0.16);
glVertex3f (-0.1,1.8,0.16);
glVertex3f (-0.5,1.8,0.16);
glEnd ();
glDisable(GL_TEXTURE_2D);
glMatrixMode(GL_MODELVIEW);
glColor3ub(127,127,127);
glBegin (GL_QUADS); //-----------les pneus arrieres
glVertex3f (-0.1,2.86,0.02); //les pneus arrieres direct terre
glVertex3f (-0.5,2.86,0.02);
glVertex3f (-0.5,2.77,0.02);
glVertex3f (-0.1,2.77,0.02);
glVertex3f (-0.5,2.77,0.02); //les pneus
glVertex3f (-0.1,2.77,0.02);
glVertex3f (-0.1,2.69,0.1);
glVertex3f (-0.5,2.69,0.1);
glVertex3f (-0.1,2.69,0.1); //les pneus
glVertex3f (-0.5,2.69,0.1);
glVertex3f (-0.5,2.77,0.2);
glVertex3f (-0.1,2.77,0.2);
glVertex3f (-0.5,2.77,0.2); //les pneus arrieres direct haut
glVertex3f (-0.1,2.77,0.2);
glVertex3f (-0.1,2.86,0.2);
glVertex3f (-0.5,2.86,0.2);
glVertex3f (-0.1,2.86,0.2); //les pneus arrieres direct haut
glVertex3f (-0.5,2.86,0.2);
glVertex3f (-0.5,2.92,0.1);
glVertex3f (-0.1,2.92,0.1);
glVertex3f (-0.1,2.92,0.2); //les pneus arrieres direct haut
glVertex3f (-0.5,2.92,0.2);
glVertex3f (-0.5,2.86,0.02);
glVertex3f (-0.1,2.86,0.02);
glEnd ();
//glLoadIdentity();
//glScalef(2,2,2);
glBegin (GL_QUADS); //-----------les pneus avant
glVertex3f (-0.1,2.03,0.02); //les pneus arrieres direct terre
glVertex3f (-0.5,2.03,0.02);
glVertex3f (-0.5,2.12,0.02);
glVertex3f (-0.1,2.12,0.02);
glVertex3f (-0.5,2.12,0.02); //les pneus
glVertex3f (-0.1,2.12,0.02);
glVertex3f (-0.1,2.17,0.1);
glVertex3f (-0.5,2.17,0.1);
glVertex3f (-0.1,2.17,0.1); //les pneus
glVertex3f (-0.5,2.17,0.1);
glVertex3f (-0.5,2.12,0.2);
glVertex3f (-0.1,2.12,0.2);
glVertex3f (-0.5,2.12,0.2); //les pneus arrieres direct haut
glVertex3f (-0.1,2.12,0.2);
glVertex3f (-0.1,2.03,0.2);
glVertex3f (-0.5,2.03,0.2);
glVertex3f (-0.1,2.03,0.2); //les pneus arrieres direct haut
glVertex3f (-0.5,2.03,0.2);
glVertex3f (-0.5,1.95,0.1);
glVertex3f (-0.1,1.95,0.1);
glVertex3f (-0.1,1.95,0.1); //les pneus arrieres direct haut
glVertex3f (-0.5,1.95,0.1);
glVertex3f (-0.5,2.03,0.02);
glVertex3f (-0.1,2.03,0.02);
glEnd ();
} |
Partager