import elharo.vrml.*;
public class city {
public static void main (String[] args) {
world city = new world();
int block = 10;
for (int street = 1; street < 250; street ++) {
for (int avenue = 1; avenue < 12; avenue++) {
Cube building = new Cube();
building.moveTo(street * block,
avenue * 4 * block, 0);
building.sizeTo(street * (block-1),
avenue*4*(block-1), 30);
city.addShape(building);
}
}
city.draw();
}
}
As long as you have an algorithmic means of describing your world it is possible to use Java to create far more complex worlds than would be possible either by writing VRML directly or by using a graphical 3-D modeler like Virtus World Builder. In fact the first worlds the author created using these techniques quickly overwhelmed and crashed his VRML viewer.