Ich arbeite an einem 3D LibGDX-Projekt und versuche, die Scheitelpunkte eines 3D-Modells zu manipulieren. Ich habe das Modell Laden, und ich habe dies als meinen Code:Was gibt die mesh.getVerticies von LibGDX aus?
Model plain = assets.get("plain.g3db", Model.class);
for(Mesh m : plain.meshes){
float[] t = m.getVertices(new float[m.getMaxVertices()]);
float[] newVerticies = new float[m.getMaxVertices()];
for(int i = 0; i < t.length-1; i++){
newVerticies[i] = t[i];
System.out.println("X: " + t[i] + " " + i);
newVerticies[i] = t[i];
System.out.println("Y: " + t[i++] + " " + i);
newVerticies[i] = random.nextInt(1-0) + 0;
System.out.println("Z: " + t[i++] + " " + i);
newVerticies[i] = t[i];
System.out.println("R: " + t[i++]);
newVerticies[i] = t[i];
System.out.println("G: " + t[i++]);
newVerticies[i] = t[i];
System.out.println("B: " + t[i++]);
newVerticies[i] = t[i];
System.out.println("A: " + t[i++]);
}
m.setVertices(newVerticies);
}
das nicht funktioniert, wie ich will es, aber ich kann das Modell zumindest sehen. Wenn ich diese Zeilen auskommentiere:
newVerticies[i] = t[i];
System.out.println("R: " + t[i++]);
newVerticies[i] = t[i];
System.out.println("G: " + t[i++]);
newVerticies[i] = t[i];
System.out.println("B: " + t[i++]);
newVerticies[i] = t[i];
System.out.println("A: " + t[i++]);
Ich bekomme nur einen schwarzen Bildschirm. Selbst wenn ich mich bewege, sehe ich nichts. Was ich wissen will, ist was genau float[] t = m.getVertices(new float[m.getMaxVertices()]);
ausgibt. Wie stimmt die Ausgabe mit dem Modell überein? Wie kann ich den Y-Wert in einem Bereich zufällig machen?