main.cpp
This is a simple to-start-with example on how to construct a simple
Scene. It contains just the necessary parts to render a red
sphere.
#include <3D/Scene.hpp>
#include <3D/Material.hpp>
#include <3D/objects/Sphere.hpp>
#include <3D/Lights.hpp>
#include <3D/Camera.hpp>
#include <wb/Parameters.hpp>
int main(int argc,const char*argv[])
{
using namespace wb;
Parameters Param(argc,argv);
Lux::Scene World;
Lux::Material Red ( rgb_real(1,0,0) );
Lux::Sphere Centralsphere( Red, vector3(0,0,0), 0.3 );
World.add(Centralsphere);
Lux::InfiniteLight Lsinf( 5*rgb_real(1.,1.,1.), vector3(0,0,1));
Lsinf.On(World);
vector3 Observer(1,-1,0);
vector3 Viewpoint(0,0,0);
Lux::Camera Kamera(Observer, Viewpoint);
Lux::Standardobjektiv Stdlens(40);
Kamera.use(Stdlens);
Kamera.action(World,Param["Camera::"],argc,argv);
return 0;
}