Search in sources :

Example 6 with PlyObject

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

the class BowlingScene method createSphereLights.

protected void createSphereLights() throws Exception {
    Transformation t = new Transformation();
    // Lampe mit Gl�hbirne hinzuf�gen:
    add(new SphereLight(new Vector3d(0.0, -1.75, 4.65), 0.05, sphereLight));
    t.reset();
    PlyObject ply = new PlyObject("ply/lamp2.ply", new ReflectiveShader(0.2f, 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.scale(0.15, 0.15, 0.15);
    t.move(0.0, -1.1, 4.65);
    ply.center();
    ply.transform(t);
    add(ply);
    // Lampe mit Gl�hbirne hinzuf�gen:
    add(new SphereLight(new Vector3d(4.2, -1.75, 4.65), 0.05, sphereLight));
    t.reset();
    ply = new PlyObject("ply/lamp2.ply", new ReflectiveShader(0.2f, 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.scale(0.15, 0.15, 0.15);
    t.move(4.2, -1.1, 4.65);
    ply.center();
    ply.transform(t);
    add(ply);
/*
        // Lampe mit Gl�hbirne hinzuf�gen:
        add(new SphereLight(new Vector3d(0,-1.75,-0.2),0.1, sphereLight));
        t.reset();
        ply = new PlyObject("ply/lamp2.ply", 
                new ReflectiveShader(0.2f, 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.scale(0.15,0.15,0.15);
        t.move(0,-1.1,-0.2);
        ply.center();
        ply.transform(t);
        add(ply);
        
        // Lampe mit Gl�hbirne hinzuf�gen:
        add(new SphereLight(new Vector3d(4.2,-1.75,-0.2),0.1, sphereLight)); 
        t.reset();
        ply = new PlyObject("ply/lamp2.ply", 
                new ReflectiveShader(0.2f, 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.scale(0.15,0.15,0.15);
        t.move(4.2,-1.1,-0.2);
        ply.center();
        ply.transform(t);
        add(ply);*/
}
Also used : SphereLight(raytracer.lights.SphereLight) Vector3d(javax.vecmath.Vector3d) PlyObject(raytracer.objects.PlyObject) Vector3f(javax.vecmath.Vector3f)

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