public static Object3D createCube(float scale) {
Object3D o = new Object3D(12);
float size = scale / 2;
// FRONT
o.addTriangle(new SimpleVector(-size, size, size), new SimpleVector(-size, -size, size), new SimpleVector(size, size, size));
o.addTriangle(new SimpleVector(size, size, size), new SimpleVector(size, -size, size), new SimpleVector(-size, -size, size));
// BACK
o.addTriangle(new SimpleVector(-size, size, -size), new SimpleVector(-size, -size, -size), new SimpleVector(size, size, -size));
o.addTriangle(new SimpleVector(size, size, -size), new SimpleVector(size, -size, -size), new SimpleVector(-size, -size, -size));
// LEFT
o.addTriangle(new SimpleVector(-size, size, size), new SimpleVector(-size, -size, size), new SimpleVector(-size, size, -size));
o.addTriangle(new SimpleVector(-size, size, -size), new SimpleVector(-size, -size, -size), new SimpleVector(-size, -size, size));
// RIGHT
o.addTriangle(new SimpleVector(size, size, size), new SimpleVector(size, -size, size), new SimpleVector(size, size, -size));
o.addTriangle(new SimpleVector(size, size, -size), new SimpleVector(size, -size, -size), new SimpleVector(size, -size, size));
// UPPER
o.addTriangle(new SimpleVector(size, size, size), new SimpleVector(-size, size, size), new SimpleVector(size, size, -size));
o.addTriangle(new SimpleVector(size, size, -size), new SimpleVector(-size, size, -size), new SimpleVector(-size, size, size));
// LOWER
o.addTriangle(new SimpleVector(size, -size, size), new SimpleVector(-size, -size, size), new SimpleVector(size, -size, -size));
o.addTriangle(new SimpleVector(size, -size, -size), new SimpleVector(-size, -size, -size), new SimpleVector(-size, -size, size));
return o;
}
Quote from: Hellfire on November 22, 2022, 12:39:50 PMGlad to hear!
Thank you, its working, i didn't have the perfect texture though
Page created in 0.061 seconds with 10 queries.