I'm using JMonkeyEngine, and trying to make objects in a cube. Meaning, a three-dimensional cube out of objects (Spheres, to be specific). However, the logic is escaping me. This is what I have so far:
for(int i = 1; i<9; i++){
for(int j=1; j<9; j++){
for(int k=1; k<9;k++){
add object
}
}
}
I'm really sitting here scratching my head, cause this gives a triangle viewed from different angles to be a different triangle. It gives a sliver of a cube. I'm looking for an algorithm for a whole cube, in pseudo code or java so I can trace it out and understand how to do this.
for(int i = 1; i<9; i++){
for(int j=1; j<9; j++){
for(int k=1; k<9;k++){
add object
}
}
}
I'm really sitting here scratching my head, cause this gives a triangle viewed from different angles to be a different triangle. It gives a sliver of a cube. I'm looking for an algorithm for a whole cube, in pseudo code or java so I can trace it out and understand how to do this.
Comment