Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package nl.vu.cs.s2.simbadtest;
- import java.awt.Color;
- import javax.vecmath.Color3f;
- import javax.vecmath.Vector3d;
- import javax.vecmath.Vector3f;
- import simbad.sim.Box;
- import simbad.sim.EnvironmentDescription;
- import simbad.sim.Wall;
- public class ExampleEnvironment extends EnvironmentDescription {
- public ExampleEnvironment() {
- // turn on the lights
- this.light1IsOn = true;
- this.light2IsOn = true;
- // enable the physics engine in order to have better physics effects on the objects
- this.setUsePhysics(true);
- // show the axes so that we know where things are
- this.showAxis(true);
- this.setWorldSize(25);
- //Main walls
- Wall mainWall1 = new Wall(new Vector3d(-12.5, 0, 0), 25, 2, this);
- mainWall1.setColor(new Color3f(Color.BLUE));
- mainWall1.rotate90(1);
- add(mainWall1);
- Wall mainWall2 = new Wall(new Vector3d(12.5, 0, 0), 25, 2, this);
- mainWall2.setColor(new Color3f(Color.BLUE));
- mainWall2.rotate90(1);
- add(mainWall2);
- Wall mainWall3 = new Wall(new Vector3d(0, 0, 12.5), 25, 2, this);
- mainWall3.setColor(new Color3f(Color.BLUE));
- add(mainWall3);
- Wall mainWall4 = new Wall(new Vector3d(0, 0, -12.5), 25, 2, this);
- mainWall4.setColor(new Color3f(Color.BLUE));
- add(mainWall4);
- //Horizontal walls
- Wall hw1 = new Wall(new Vector3d(-2.5, 0, -5), 5, 2, this);
- hw1.setColor(new Color3f(Color.RED));
- hw1.rotate90(1);
- add(hw1);
- Wall hw2 = new Wall(new Vector3d(-2.5, 0, 5), 5, 2, this);
- hw2.setColor(new Color3f(Color.RED));
- hw2.rotate90(1);
- add(hw2);
- Wall hw3 = new Wall(new Vector3d(7.5, 0, -7.5), 10, 2, this);
- hw3.setColor(new Color3f(Color.RED));
- hw3.rotate90(1);
- add(hw3);
- Wall hw4 = new Wall(new Vector3d(2.5, 0, 5), 15, 2, this);
- hw4.setColor(new Color3f(Color.RED));
- hw4.rotate90(1);
- add(hw4);
- Wall hw5 = new Wall(new Vector3d(-7.5, 0, 10), 5, 2, this);
- hw5.setColor(new Color3f(Color.RED));
- hw5.rotate90(1);
- add(hw5);
- //Vertical walls
- Wall vw1 = new Wall(new Vector3d(-7.5, 0, 2.5), 10, 2, this);
- vw1.setColor(new Color3f(Color.RED));
- add(vw1);
- Wall vw2 = new Wall(new Vector3d(-10, 0, -2.5), 5, 2, this);
- vw2.setColor(new Color3f(Color.RED));
- add(vw2);
- Wall vw3 = new Wall(new Vector3d(-5, 0, -7.5), 5, 2, this);
- vw3.setColor(new Color3f(Color.RED));
- add(vw3);
- Wall vw4 = new Wall(new Vector3d(5, 0, -7.5), 5, 2, this);
- vw4.setColor(new Color3f(Color.RED));
- add(vw4);
- Wall vw5 = new Wall(new Vector3d(0, 0, -2.5), 5, 2, this);
- vw5.setColor(new Color3f(Color.RED));
- add(vw5);
- Wall vw6 = new Wall(new Vector3d(5, 0, 7.5), 5, 2, this);
- vw6.setColor(new Color3f(Color.RED));
- add(vw6);
- Wall vw7 = new Wall(new Vector3d(10, 0, 2.5), 5, 2, this);
- vw7.setColor(new Color3f(Color.RED));
- add(vw7);
- //Box
- Box box1 = new Box(new Vector3d(-10, 0, 10), new Vector3f(1, 1, 1), this);
- box1.setColor(new Color3f(Color.GREEN));
- add(box1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement