ccdemos/realtime_dragon.cc
author Radek Brich <radek.brich@devl.cz>
Wed, 19 Mar 2008 17:18:59 +0100
branchpyrit
changeset 45 76b254ce92cf
parent 40 929aad02c5f2
child 62 07c2f8084719
permissions -rw-r--r--
note for new camera classes

#include "raytracer.h"
#include "octree.h"

#include "common_sdl.h"
#include "common_ply.h"

int main(int argc, char **argv)
{
	Raytracer rt;
	Octree top;
	Camera cam;

	rt.setMaxDepth(0);
	rt.setTop(&top);

	Light light1(Vector3(-5.0, 2.0, 8.0), Colour(0.9, 0.3, 0.6));
	light1.castShadows(false);
	rt.addlight(&light1);

	//Light light2(Vector3(-2.0, 10.0, 2.0), Colour(0.4, 0.6, 0.3));
	//light2.castShadows(false);
	//rt.addlight(&light2);

	Material mat(Colour(0.9, 0.9, 0.9));
	load_ply(rt, "../models/dragon/dragon_vrip.ply", &mat, Vector3(-29,29,-29), Vector3(0,-3.6,0));

	rt.setCamera(&cam);
	cam.setEye(Vector3(0,0,10));

	top.optimize();

	loop_sdl(rt, cam);
}