[LWJGL] Problème avec triangle 3D
Bonjour, j'ai mis ce code là dans mon éditeur (Eclipse):
Code:
1 2 3 4 5 6 7 8 9
| public static void setEnemyData(float x0, float y0, float z0, float x1, float y1, float z1, Vector3f color) {
glColor3f(color.getX(), color.getY(), color.getZ());
glTexCoord3f((0) / offs, (0) / offs, (0) / offs); glVertex3f(x1, y0, z1);
glTexCoord3f((1) / offs, (0) / offs, (0) / offs); glVertex3f(x1, y1, z1);
glTexCoord3f((1) / offs, (1) / offs, (0) / offs); glVertex3f(x0, y1, z0);
glTexCoord3f((0) / offs, (1) / offs, (1) / offs); glVertex3f(x0, y0, z0);
} |
Voici les informations supplémentaires:
Méthode appelée par:
Code:
1 2 3
| GL11.glBegin(GL11.GL_QUADS);
Renderer.setEnemyData(enemyPosition.getX(), enemyPosition.getY(), enemyPosition.getZ(), enemyPosition.getX() + enemySizeX, enemyPosition.getY() + enemySizeY, enemyPosition.getZ() + enemySizeZ, new Vector3f(1, 0, 0));
GL11.glEnd(); |
enemyPosition:
Code:
Vector3f enemyPosition = new Vector3f(13, 0.4f, 13);
Variables:
Code:
1 2 3 4
| public static float enemySizeZ = 0.40f;
public static float enemySizeX = 0.40f;
public static float enemySizeY = 0.40f;
public static float enemySpeed = 0.025f; |
Le problème, c'est que je veux un triangle en trois dimensions, et pas en deux dimensions :lol: