All pastes #636836 Raw Edit

Anonymous

public text v1 · immutable
#636836 ·published 2007-07-28 08:00 UTC
rendered paste body

	IMesh* shipMesh = smgr->getMesh("media/ships/naves_fin.ms3d")->getMesh(0);

	for(int g = 0; g < 10; ++g)
	{
		for(int z = 0; z < 10; ++z)
		{
			ship1 = smgr->addMeshSceneNode(shipMesh);
			ship1->setMaterialTexture(0,driver->getTexture("media/ships/textur.png"));
			ship1->setMaterialTexture(1,driver->getTexture("media/ships/modMap.png"));
			ship1->setMaterialTexture(2,driver->getTexture("media/skyup.jpg"));	
			float shipCo[4];
			srand(device->getTimer()->getRealTime());
			shipCo[0] = float(rand()%255) / 255;
			
			shipCo[1] = float(rand()%255) / 255;
			
			shipCo[2] = float(rand()%255) / 255;
			
			shipCo[3] = float(rand()%255) / 255;

			ShipShaderCB* shipCB = new ShipShaderCB(shipCo);

			int ShipMat = gpu->addHighLevelShaderMaterialFromFiles(
			shipMatFN,	"vertexMain", video::EVST_VS_1_1,
			shipMatFN, "pixelMain", video::EPST_PS_1_4,
			shipCB, video::EMT_SOLID);

			ship1->setMaterialType((E_MATERIAL_TYPE)ShipMat);
	
			ship1->setRotation(vector3df(0,90,0));
			ship1->setPosition(vector3df(g * 15 + 5,15,z * 15 - 10));

			ship1->setParent(shipRoot);

		
		
		}
	}