3.cpp

Very simple example showing an extremly artifical scene. May be used as an introductory example when starting with more complex scenes. The `LuxColorizont' is quite useful for debugging purposes.

3.jpg

#include <stdio.h>
#include <wb/error.hpp>
#include <3D/3D.hpp>
#include <3D/Lights.hpp>
#include <3D/Material.hpp>
#include <3D/Scene.hpp>
#include <3D/Camera.hpp>
#include <3D/objects/planeobjs.hpp>
#include <3D/objects/Sphere.hpp>
#include <3D/objects/colorizont.hpp>
#include <wb/options.hpp>
#include <wb/Parameters.hpp>

main(int argc, const char*argv[])
{
        using namespace wb;
        using namespace Lux;
Parameters Params(argc,argv);

Scene   Welt;
Material bg = rgb_real(0.4,0.0,0.6);
        bg.transparency = rgb_real(0,0,0);
        Welt.defBackground(bg);

InfiniteLight   Lsinf(6*rgb_real(1.,1.,1.),vector3(0,0,5));
AmbientLight    Lsa(.05*rgb_real(1,1,1));

        Lsinf.On(Welt);
        Lsa.On(Welt);

Material        sP = .3*rgb_real(1,1,1);
Colorizont P( sP, vector3(0,0,-2), vector3(0,0,1));
        Welt.add(P);
        P.name = "Horizontebene";

Material        Sp = Material::papier;

vector3 A( -4,-4,0), B(-4, 4, 0), C(+5.6, 0, 0);

        Sp.Object2D = true;
Trigon  Tbottom( Sp, A, C, B);
        Tbottom.name = "Trigon, unten";
        Welt.add(Tbottom);

Sphere KA( A, 1, Sp), KB( B, 1, Sp), KC( C, 1, Sp);
        Welt.add(KA).add(KB).add(KC);

Camera            Kamera(voption(argc,argv,"Standpunkt",vector3(0,-20,5)),
                         voption(argc,argv,"Blickpunkt",vector3(0,  0,0)) );
Standardobjektiv  Stdlens(ioption(argc,argv,"angle",40));
        Kamera.use(Stdlens);

        Kamera.action(Welt, Params["Camera::"], argc,argv);

        return 0;
}


Generated on Wed Jun 17 20:00:14 2009 for Light++ by  doxygen 1.5.6