ccdemos/realtime_dragon.cc
branchpyrit
changeset 91 9d66d323c354
parent 80 907929fa9b59
child 92 9af5c039b678
equal deleted inserted replaced
90:f6a72eb99631 91:9d66d323c354
    12 	Camera cam;
    12 	Camera cam;
    13 
    13 
    14 	rt.setMaxDepth(0);
    14 	rt.setMaxDepth(0);
    15 	rt.setTop(&top);
    15 	rt.setTop(&top);
    16 	rt.setCamera(&cam);
    16 	rt.setCamera(&cam);
    17 	cam.setEye(Vector3(0,0,10));
    17 	cam.setEye(Vector(0,0,10));
    18 
    18 
    19 	Light light1(Vector3(-5.0, 2.0, 8.0), Colour(0.9, 0.3, 0.6));
    19 	Light light1(Vector(-5.0, 2.0, 8.0), Colour(0.9, 0.3, 0.6));
    20 	light1.castShadows(false);
    20 	light1.castShadows(false);
    21 	rt.addLight(&light1);
    21 	rt.addLight(&light1);
    22 
    22 
    23 	//Light light2(Vector3(-2.0, 10.0, 2.0), Colour(0.4, 0.6, 0.3));
    23 	//Light light2(Vector(-2.0, 10.0, 2.0), Colour(0.4, 0.6, 0.3));
    24 	//light2.castShadows(false);
    24 	//light2.castShadows(false);
    25 	//rt.addlight(&light2);
    25 	//rt.addlight(&light2);
    26 
    26 
    27 	Material mat(Colour(0.9, 0.9, 0.9));
    27 	Material mat(Colour(0.9, 0.9, 0.9));
    28 	mat.setSmooth(true);
    28 	mat.setSmooth(true);
    32 
    32 
    33 	ifstream fin("realtime_dragon.kdtreedump");
    33 	ifstream fin("realtime_dragon.kdtreedump");
    34 	if (!fin)
    34 	if (!fin)
    35 	{
    35 	{
    36 		load_ply(rt, "../models/ply/dragon/dragon_vrip.ply",
    36 		load_ply(rt, "../models/ply/dragon/dragon_vrip.ply",
    37 			&mat, Vector3(-29,29,-29), Vector3(0,-3.6,0));
    37 			&mat, Vector(-29,29,-29), Vector(0,-3.6,0));
    38 		top.optimize();
    38 		top.optimize();
    39 	}
    39 	}
    40 	else
    40 	else
    41 		top.load(fin, &mat);
    41 		top.load(fin, &mat);
    42 
    42