Search in sources :

Example 1 with PlyObject

use of raytracer.objects.PlyObject in project narchy by automenta.

the class BowlingScene method createLeftPins.

protected void createLeftPins() throws Exception {
    Transformation t = new Transformation();
    /**
     * !!! Linke Bahn !!!
     */
    // Kegel
    // Hintere Reihe
    t.reset();
    PlyObject ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(-2.20, -5.205, -4.1);
    ply.center();
    ply.transform(t);
    add(ply);
    // 
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(-1.85, -5.205, -4.1);
    ply.center();
    ply.transform(t);
    add(ply);
    // 
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(-1.5, -5.205, -4.1);
    ply.center();
    ply.transform(t);
    add(ply);
    // 
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(-1.15, -5.205, -4.1);
    ply.center();
    ply.transform(t);
    add(ply);
    // 2te von hinten
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(-1.325, -5.205, -3.81);
    ply.center();
    ply.transform(t);
    add(ply);
    // 
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(-1.675, -5.205, -3.81);
    ply.center();
    ply.transform(t);
    add(ply);
    // 
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(-2.025, -5.205, -3.81);
    ply.center();
    ply.transform(t);
    add(ply);
    // 3te von hinten
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(-1.85, -5.205, -3.52);
    ply.center();
    ply.transform(t);
    add(ply);
    // 
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(-1.5, -5.205, -3.52);
    ply.center();
    ply.transform(t);
    add(ply);
    // vorne
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(-1.675, -5.205, -3.23);
    ply.center();
    ply.transform(t);
    add(ply);
}
Also used : PlyObject(raytracer.objects.PlyObject)

Example 2 with PlyObject

use of raytracer.objects.PlyObject in project narchy by automenta.

the class BowlingScene method createRoom.

protected void createRoom() {
    try {
        Transformation t = new Transformation();
        Shader roadShader = new ReflectiveShader(0.15f, new ReflectionShader(1.4f, new PhongShader(new TextureShader("texture/bowlRoad.jpg"), new Vector3f(0.3f, 0.3f, 0.3f), new Vector3f(0.5f, 0.5f, 0.5f), new Vector3f(0.8f, 0.8f, 0.8f))));
        Shader backRoadShader = new ReflectionShader(1.2f, new PhongShader(new TextureShader("texture/BackRoad.jpg"), new Vector3f(0.4f, 0.4f, 0.4f), new Vector3f(0.7f, 0.7f, 0.7f), new Vector3f(0.5f, 0.5f, 0.5f)));
        Shader sideRoadShader = new PhongShader(new TextureShader("texture/sideRoad.jpg"), new Vector3f(0.3f, 0.3f, 0.3f), new Vector3f(0.4f, 0.4f, 0.4f), new Vector3f(0.7f, 0.7f, 0.7f));
        Shader bowlingHolderShader = new ReflectiveShader(0.2f, new PhongShader(new TextureShader("texture/BowlHolder.jpg"), new Vector3f(0.3f, 0.3f, 0.2f), new Vector3f(0.6f, 0.6f, 0.5f), new Vector3f(0.95f, 0.95f, 0.8f)));
        Shader rampShader = new ReflectiveShader(0.1f, new PhongShader(new ColorShader(ColorEx.DARK_GRAY), new Vector3f(0.3f, 0.3f, 0.3f), new Vector3f(0.7f, 0.7f, 0.7f), new Vector3f(0.5f, 0.5f, 0.5f)));
        // linke Bahn
        t.reset();
        PlyObject ply = new PlyObject("ply/BowlingRoad.ply", roadShader);
        t.scale(1.0, 1.0, 1.0);
        t.move(-1.7, -5.44, 0.0);
        ply.center();
        ply.transform(t);
        t.reset();
        t.rotate(10.0, 0.0, 0.0, 1.0);
        ply.transformTexture(t);
        add(ply);
        // mittler Bahn
        t.reset();
        ply = new PlyObject("ply/BowlingRoad.ply", roadShader);
        t.scale(1.0, 1.0, 1.0);
        t.move(2.301, -5.44, 0.0);
        ply.center();
        ply.transform(t);
        t.reset();
        t.rotate(-3.0, 0.0, 0.0, 1.0);
        t.move(0.3, 0.2, 0.0);
        ply.transformTexture(t);
        add(ply);
        // rechte Bahn
        t.reset();
        ply = new PlyObject("ply/BowlingRoad.ply", roadShader);
        t.scale(1.0, 1.0, 1.0);
        t.move(6.16, -5.44, 0.0);
        ply.center();
        ply.transform(t);
        t.reset();
        t.rotate(-15.0, 0.0, 0.0, 1.0);
        t.move(0.1, 0.7, 0.0);
        ply.transformTexture(t);
        add(ply);
        // Back Road links
        t.reset();
        ply = new PlyObject("ply/BowlingBackRoad.ply", backRoadShader, true, new RoughNormalEffect(0.1f));
        t.scale(0.47, 0.47, 0.47);
        t.move(0.29, -5.43, -0.14);
        ply.center();
        ply.transform(t);
        t.reset();
        t.scale(6.0, 6.0, 0.0);
        ply.transformTexture(t);
        add(ply);
        // Back Road Rechts
        t.reset();
        ply = new PlyObject("ply/BowlingBackRoad.ply", backRoadShader, true, new RoughNormalEffect(0.1f));
        t.scale(0.45, 0.45, 0.45);
        t.move(4.225, -5.43, 0.1);
        ply.center();
        ply.transform(t);
        t.reset();
        t.scale(6.0, 6.0, 0.0);
        t.rotate(100.0, 0.0, 0.0, 1.0);
        ply.transformTexture(t);
        add(ply);
        // Sideroad links
        t.reset();
        ply = new PlyObject("ply/BowlingSideRoad.ply", sideRoadShader);
        t.scale(1.1, 1.1, 1.1);
        t.move(-2.95, -5.44, -0.3);
        ply.center();
        ply.transform(t);
        add(ply);
        // Sideroad rechts
        t.reset();
        ply = new PlyObject("ply/BowlingSideRoad.ply", sideRoadShader);
        t.scale(1.1, 1.1, 1.1);
        t.move(7.4, -5.43, -0.3);
        ply.center();
        ply.transform(t);
        add(ply);
        // Rampe
        t.reset();
        ply = new PlyObject("ply/BowlingRampe.ply", rampShader, new RoughNormalEffect(0.5f));
        ply.normalize();
        t.scale(5.5, 5.5, 5.5);
        t.move(2.2, -5.46, 4.65);
        ply.center();
        ply.transform(t);
        add(ply);
        // Holder links
        t.reset();
        ply = new PlyObject("ply/BowlingHolder.ply", bowlingHolderShader);
        t.move(0.33, -5.1, 4.65);
        ply.center();
        ply.transform(t);
        add(ply);
        // Holder rechts
        t.reset();
        ply = new PlyObject("ply/BowlingHolder.ply", bowlingHolderShader);
        t.move(4.27, -5.1, 4.65);
        ply.center();
        ply.transform(t);
        add(ply);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : PlyObject(raytracer.objects.PlyObject) Vector3f(javax.vecmath.Vector3f) RoughNormalEffect(raytracer.effects.RoughNormalEffect)

Example 3 with PlyObject

use of raytracer.objects.PlyObject in project narchy by automenta.

the class BowlingScene method createMiddlePins.

protected void createMiddlePins() throws Exception {
    Transformation t = new Transformation();
    /**
     * Mittler Bahn
     */
    // Kegel
    // Hintere Reihe
    t.reset();
    PlyObject ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(1.659, -5.205, -4.1);
    ply.center();
    ply.transform(t);
    add(ply);
    // 
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(2.709, -5.205, -4.1);
    ply.center();
    ply.transform(t);
    add(ply);
    // 2te von hinten
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-90.0, -1.0, 0.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(2.534, -5.205, -3.81);
    ply.center();
    ply.transform(t);
    add(ply);
    // Umgefallen
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(180.0, 1.0, 0.0, 0.0);
    t.rotate(-90.0, 0.0, 0.0, -1.0);
    t.rotate(-34.0, 0.0, -1.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(2.234, -5.36, -3.71);
    ply.center();
    ply.transform(t);
    add(ply);
    // Umgefallen
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(80.0, 1.0, 0.0, 0.0);
    t.rotate(-90.0, 0.0, 0.0, -1.0);
    t.rotate(-56.0, 0.0, -1.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(2.0, -5.36, -4.1);
    ply.center();
    ply.transform(t);
    add(ply);
    // Umgefallen
    t.reset();
    ply = new PlyObject("ply/pin.ply", pinShader, true);
    t.rotate(-70.0, 1.0, 0.0, 0.0);
    t.rotate(-90.0, 0.0, 0.0, -1.0);
    t.rotate(-56.0, 0.0, -1.0, 0.0);
    t.scale(0.033, 0.033, 0.033);
    t.move(2.5, -5.36, -4.3);
    ply.center();
    ply.transform(t);
    add(ply);
}
Also used : PlyObject(raytracer.objects.PlyObject)

Example 4 with PlyObject

use of raytracer.objects.PlyObject in project narchy by automenta.

the class BowlingScene method createHouse.

protected void createHouse() throws Exception {
    Transformation t = new Transformation();
    // Haus erzeugen:
    t.reset();
    PlyObject ply = new PlyObject("ply/BowlingHouse.ply", new PhongShader(new WallShader(new ColorEx(1.0f, 1.0f, 0.9f)), new Vector3f(0.6f, 0.6f, 0.6f), new Vector3f(1.0f, 0.9f, 0.9f), new Vector3f(0.7f, 0.7f, 0.6f)), new RoughNormalEffect(0.2f));
    t.rotate(-90.0, 1.0, 0.0, 0.0);
    ply.transform(t);
    add(ply);
    // R�ckwand erzeugen:
    t.reset();
    ply = new PlyObject("ply/BowlingHoleWall.ply", new PhongShader(new TextureShader("texture/HoleWall.jpg"), new Vector3f(0.4f, 0.4f, 0.4f), new Vector3f(0.7f, 0.7f, 0.8f), new Vector3f(0.5f, 0.5f, 0.6f)));
    t.move(4.175, -5.32, -0.55);
    ply.transform(t);
    t.reset();
    t.scale(3.0, 3.0, 0.0);
    ply.transformTexture(t);
    add(ply);
    // T�r erzeugen:
    t.reset();
    ply = new PlyObject("ply/BowlingDoor.ply", new PhongShader(new TextureShader("texture/Door.jpg"), new Vector3f(0.3f, 0.3f, 0.3f), new Vector3f(0.4f, 0.4f, 0.4f), new Vector3f(0.7f, 0.7f, 0.7f)));
    t.move(5.5, -4.45, 8.0);
    ply.center();
    ply.transform(t);
    add(ply);
}
Also used : PlyObject(raytracer.objects.PlyObject) Vector3f(javax.vecmath.Vector3f) RoughNormalEffect(raytracer.effects.RoughNormalEffect)

Example 5 with PlyObject

use of raytracer.objects.PlyObject in project narchy by automenta.

the class BowlingScene method createAreaLights.

protected void createAreaLights() throws Exception {
    Transformation t = new Transformation();
    // Fl�chige Lampe hinzuf�gen:
    add(new AreaLight(new Vector3d(-1.5, -0.8, 2.5), new Vector3d(0.07, 0.0, 0.0), new Vector3d(0.0, 0.0, 0.7), areaLight));
    t.reset();
    PlyObject ply = new PlyObject("ply/lamp3.ply", new PhongShader(new ColorShader(ColorEx.WHITE), new Vector3f(0.3f, 0.3f, 0.3f), new Vector3f(0.4f, 0.4f, 0.4f), new Vector3f(0.7f, 0.7f, 0.7f)));
    t.rotate(-90.0, 0.0, -1.0, 0.0);
    t.scale(0.1, 0.1, 0.1);
    t.move(-1.5, -0.3, 2.5);
    ply.center();
    ply.transform(t);
    add(ply);
    // Fl�chige Lampe hinzuf�gen:
    add(new AreaLight(new Vector3d(5.9, -0.8, 2.5), new Vector3d(0.07, 0.0, 0.0), new Vector3d(0.0, 0.0, 0.7), areaLight));
    t.reset();
    ply = new PlyObject("ply/lamp3.ply", new PhongShader(new ColorShader(ColorEx.WHITE), new Vector3f(0.3f, 0.3f, 0.3f), new Vector3f(0.4f, 0.4f, 0.4f), new Vector3f(0.7f, 0.7f, 0.7f)));
    t.rotate(-90.0, 0.0, -1.0, 0.0);
    t.scale(0.1, 0.1, 0.1);
    t.move(5.9, -0.3, 2.5);
    ply.center();
    ply.transform(t);
    add(ply);
    // Fl�chige Lampe hinzuf�gen:
    add(new AreaLight(new Vector3d(5.9, -0.8, 6.8), new Vector3d(0.07, 0.0, 0.0), new Vector3d(0.0, 0.0, 0.7), areaLight));
    t.reset();
    ply = new PlyObject("ply/lamp3.ply", new PhongShader(new ColorShader(ColorEx.WHITE), new Vector3f(0.3f, 0.3f, 0.3f), new Vector3f(0.4f, 0.4f, 0.4f), new Vector3f(0.7f, 0.7f, 0.7f)));
    t.rotate(-90.0, 0.0, -1.0, 0.0);
    t.scale(0.1, 0.1, 0.1);
    t.move(5.9, -0.3, 6.8);
    ply.center();
    ply.transform(t);
    add(ply);
    // Fl�chige Lampe hinzuf�gen:
    add(new AreaLight(new Vector3d(-1.5, -0.8, 6.8), new Vector3d(0.07, 0.0, 0.0), new Vector3d(0.0, 0.0, 0.7), areaLight));
    t.reset();
    ply = new PlyObject("ply/lamp3.ply", new PhongShader(new ColorShader(ColorEx.WHITE), new Vector3f(0.3f, 0.3f, 0.3f), new Vector3f(0.4f, 0.4f, 0.4f), new Vector3f(0.7f, 0.7f, 0.7f)));
    t.rotate(-90.0, 0.0, -1.0, 0.0);
    t.scale(0.1, 0.1, 0.1);
    t.move(-1.5, -0.3, 6.8);
    ply.center();
    ply.transform(t);
    add(ply);
}
Also used : Vector3d(javax.vecmath.Vector3d) PlyObject(raytracer.objects.PlyObject) Vector3f(javax.vecmath.Vector3f) AreaLight(raytracer.lights.AreaLight)

Aggregations

PlyObject (raytracer.objects.PlyObject)6 Vector3f (javax.vecmath.Vector3f)4 Vector3d (javax.vecmath.Vector3d)2 RoughNormalEffect (raytracer.effects.RoughNormalEffect)2 AreaLight (raytracer.lights.AreaLight)1 SphereLight (raytracer.lights.SphereLight)1