Exemplo n.º 1
0
Planet::Planet(Camera *cam, class Geometry *parent){
	camera = cam;
	mat = new Material("Textures/Backdrops/Planet5",Texture::cARGB);
	mat->SetMode(MATERIAL_SOURCE_DIFFUSE|MATERIAL_DEST_MULTIPLY_ONE_MINUS_ALPHA);
	Geometry *g = new Geometry();
	g->SetName(0,"Planet");
	g->Apply(mat);
	g->Add(Vector(-6000, 6000,0));
	g->Add(Vector( 6000, 6000,0));
	g->Add(Vector( 6000,-6000,0));
	g->Add(Vector(-6000,-6000,0));
	g->Add(Vertex(0,0,0));
	g->Add(Vertex(1,1,0));
	g->Add(Vertex(2,1,1));
	g->Add(Vertex(3,0,1));
	IndexedPolygon *pol;
	pol = /*g->NewIndexedPolygon();*/ new IndexedPolygon(g);
	pol->Add(0);
	pol->Add(1);
	pol->Add(2);
	pol->Add(3);
	Intelligence::Apply(g);
	g->Node::Apply(0,this);
	parent->Node::Apply(0,g);
	SetPosition(Vector(0,0,0));
g->SetSquareRadius(0);
}
Exemplo n.º 2
0
Sun::Sun(Camera *cam, class Geometry *parent){
	camera = cam;
	mat1 = new Material("Textures/Lens/Halo",Texture::cRGB);
	mat1->SetMode(MATERIAL_SOURCE_DIFFUSE|MATERIAL_DEST_ADD_SOURCE); //MATERIAL_DEST_MULTIPLY_ONE_MINUS_ALPHA);
	mat2 = new Material("Textures/Lens/Sun",Texture::cRGB);
	mat2->SetMode(MATERIAL_SOURCE_DIFFUSE|MATERIAL_DEST_ADD_SOURCE); //MULTIPLY_ONE_MINUS_ALPHA);
//mat1->SetTransparency(.6f);
//mat2->SetTransparency(.8f);
mat1->SetTransparency(.95f);
mat2->SetTransparency(.8f);
	Geometry *g = new Geometry();
	g->SetName(0,"Sun");
	g->Apply(mat1);
/*
	g->Add(Vector(-6000/2/3, 6000/2/3,0));
	g->Add(Vector( 6000/2/3, 6000/2/3,0));
	g->Add(Vector( 6000/2/3,-6000/2/3,0));
	g->Add(Vector(-6000/2/3,-6000/2/3,0));
	g->Add(Vector(-6000*5/2, 6000*5/2,-10000));
	g->Add(Vector( 6000*5/2, 6000*5/2,-10000));
	g->Add(Vector( 6000*5/2,-6000*5/2,-10000));
	g->Add(Vector(-6000*5/2,-6000*5/2,-10000));
*/
	g->Add(Vector(-6000*5/2, 6000*5/2,0));
	g->Add(Vector( 6000*5/2, 6000*5/2,0));
	g->Add(Vector( 6000*5/2,-6000*5/2,0));
	g->Add(Vector(-6000*5/2,-6000*5/2,0));
	g->Add(Vector(-6000*5/2, 6000*5/2,-10000));
	g->Add(Vector( 6000*5/2, 6000*5/2,-10000));
	g->Add(Vector( 6000*5/2,-6000*5/2,-10000));
	g->Add(Vector(-6000*5/2,-6000*5/2,-10000));

	g->Add(Vertex(0,0,0));
	g->Add(Vertex(1,1,0));
	g->Add(Vertex(2,1,1));
	g->Add(Vertex(3,0,1));
	g->Add(Vertex(4,0,0));
	g->Add(Vertex(5,1,0));
	g->Add(Vertex(6,1,1));
	g->Add(Vertex(7,0,1));
	IndexedPolygon *pol;

	pol = new IndexedPolygon(g); //new IndexedPolygon(g);
	pol->Add(0);
	pol->Add(1);
	pol->Add(2);
	pol->Add(3);
//pol->Apply(mat1);

/*	pol = new IndexedPolygon(g); //new IndexedPolygon(g);
	pol->Apply(mat2);
	pol->Add(4);
	pol->Add(5);
	pol->Add(6);
	pol->Add(7);*/
	Intelligence::Apply(g);
	g->Node::Apply(0,this);
	parent->Node::Apply(0,g);
	SetPosition(Vector(0,0,50000));
g->SetSquareRadius(0);
}