swapTexWrap added

This commit is contained in:
Antoine
2021-05-20 19:02:28 +02:00
parent 859344b131
commit 4fc87e7b08
6 changed files with 56 additions and 7 deletions

View File

@ -6,20 +6,30 @@ public class Primitive {
public static float[] createRectangle(float x, float y, float z, float w, float h){
return new float[] {
x , y , z,
x + w, y , z,
x + w, y - h, z,
x , y - h, z
x , y , z, // Haut gauche
x + w, y , z, // Haut droit
x + w, y - h, z, // Bas droit
x , y - h, z // Bas gauche
};
}
/**
* Chaque point correspond à un vertex de la primite le reste est interpolé
*/
public static float[] stdTexWrap = new float[] {
1.0f, 1.0f,
1.0f, 0.0f,
0.0f, 0.0f,
1.0f, 0.0f,
1.0f, 1.0f,
0.0f, 1.0f
};
public static float[] upperHalfTexWrap = new float[] {
0.0f, 0.0f,
1.0f, 0.0f,
1.0f, 0.5f,
0.0f, 0.5f
};
public static byte[] rectangle_indices = new byte[] {
0, 1, 3,
1, 2, 3