//ESTE TEMPLATE CREA UNA ESCENA EN IRRLICHT Y CREA UN CUBO PARA SER MOSTRADO CON UNA CAMARAa_m_t486@hotmail.com
#include
#include
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main() {
// Inicializamos Irrlicht
IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d
// Guardamos los apuntadores que serán de utilidad
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
// Le ponemos un título a nuestra ventana
device->setWindowCaption(L"Hola Mundo en Irrlicht [--A M T--]");
ISceneNode* cubo = smgr->addCubeSceneNode();
cubo->setPosition(vector3df(0,0,5));
cubo->setScale(vector3df(1,1,1));
cubo->setRotation(vector3df(0,0,5));
smgr->addCameraSceneNode(0, vector3df(0, 30, -40), vector3df(0, 0, 0));
// El ciclo principal de nuestra aplicación
while (device->run())
{
cubo->setRotation(cubo->getRotation() + vector3df(0,1,0.005));
driver->beginScene(true, true, SColor(255, 255, 255, 140));
smgr->drawAll();
driver->endScene();
}
// Nos aseguramos de cerrar de manera adecuada Irrlicht
device->drop();
// Siempre es bueno regresar un cero para indicar que todo salió bien
return 0;
}
No hay comentarios:
Publicar un comentario