Mapka i Kolizja x10 i Poprawiona trawa
This commit is contained in:
19
main.cpp
19
main.cpp
@@ -474,22 +474,27 @@ void skrzynka(GLfloat k) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void platforma(GLfloat xc, GLfloat yc, GLfloat zc, GLfloat xlen, GLfloat zlen) {
|
void platforma(GLfloat xc, GLfloat yc, GLfloat zc, GLfloat xlen, GLfloat zlen) {
|
||||||
|
glColor3d(0.729, 0.91, 0.51); // jasnozielony, dla grass02.bmp
|
||||||
|
|
||||||
glColor3d(0.729, 0.91, 0.51); // jasnozielony, dla grass02.bmp (https://rgbcolorpicker.com/0-1)
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, texture[1]); // Wybieramy teksturę
|
||||||
|
|
||||||
|
// Ustawienie powtarzania tekstury
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); // Powtarzanie w kierunku S
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); // Powtarzanie w kierunku T
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, texture[1]);
|
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
glTexCoord2d(1.0, 1.0); glVertex3d(xc - xlen, yc, zc - zlen);
|
// Powtarzające się współrzędne tekstury (np. *5, aby powtórzyła się 5 razy)
|
||||||
glTexCoord2d(1.0, 0.0); glVertex3d(xc + xlen, yc, zc - zlen);
|
glTexCoord2d(5.0, 5.0); glVertex3d(xc - xlen, yc, zc - zlen); // Lewy dolny
|
||||||
glTexCoord2d(0.0, 0.0); glVertex3d(xc + xlen, yc, zc + zlen);
|
glTexCoord2d(5.0, 0.0); glVertex3d(xc + xlen, yc, zc - zlen); // Prawy dolny
|
||||||
glTexCoord2d(0.0, 1.0); glVertex3d(xc - xlen, yc, zc + zlen);
|
glTexCoord2d(0.0, 0.0); glVertex3d(xc + xlen, yc, zc + zlen); // Prawy górny
|
||||||
|
glTexCoord2d(0.0, 5.0); glVertex3d(xc - xlen, yc, zc + zlen); // Lewy górny
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void stodola(GLfloat xc, GLfloat yc, GLfloat zc, GLfloat krawedz) {
|
void stodola(GLfloat xc, GLfloat yc, GLfloat zc, GLfloat krawedz) {
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
|||||||
Reference in New Issue
Block a user