рд╢реБрд░реБрдЖрддреА рдХреЗ рд▓рд┐рдП рдЗрд░рд┐рдХреНрд▓рд┐рдкреНрдЯ рдЗрдВрдЬрди рдмреЗрд╕рд┐рдХреНрд╕

рдореИрдВ рдЗрд░рдХреНрд▓рд┐рдХреНрдЯ рдЗрдВрдЬрди рдХреЗ рд░реВрдк рдореЗрдВ рдЗрд╕ рддрд░рд╣ рдХреА рдПрдХ рджрд┐рд▓рдЪрд╕реНрдк рдмрд╛рдд рдХрд░рдирд╛ рдЪрд╛рд╣рддрд╛ рд╣реВрдВред рд╕рдмрд╕реЗ рдкрд╣рд▓реЗ, рдЖрдЗрдП рддрдп рдХрд░реЗрдВ рдХрд┐ рдпрд╣ рд╕рдм рдХреНрдпрд╛ рд╣реИред Irrlicht C ++ рдореЗрдВ рд▓рд┐рдЦрд╛ рдЧрдпрд╛ рдПрдХ рд╢рдХреНрддрд┐рд╢рд╛рд▓реА 3D рдЧреНрд░рд╛рдлрд┐рдХреНрд╕ рдЗрдВрдЬрди рд╣реИред рдпрд╣ рдЪрдорддреНрдХрд╛рд░ рд╕рд░рд▓ 2 рдбреА рдФрд░ 3 рдбреА рдЕрдиреБрдкреНрд░рдпреЛрдЧреЛрдВ рдХреЗ рд╡рд┐рдХрд╛рд╕ рдФрд░ рдЦреЗрд▓реЛрдВ рдХреЗ рд▓рд┐рдП рдЙрдкрдпреБрдХреНрдд рд╣реИред рдХрд┐рд╕реА рднреА рдЕрдиреНрдп рдЗрдВрдЬрди рдХреА рддрд░рд╣, Irrlicht рдореЗрдВ рдХрдИ рд╡рд┐рд╢реЗрд╖рддрд╛рдПрдВ рд╣реИрдВ, рдЬрд┐рдирдореЗрдВ рд╕реЗ рдореБрдЦреНрдп рдкреНрд▓реЗрдЯрдлрд╝реЙрд░реНрдо рд╕реНрд╡рддрдВрддреНрд░рддрд╛ рд╣реИ, рдЕрд░реНрдерд╛рдд, рдПрдХ рдкреНрд░реЛрдЧреНрд░рд╛рдорд░ рдЬрд┐рд╕рдиреЗ рд╡рд┐рдВрдбреЛрдЬ рдХреЗ рд▓рд┐рдП рдПрдХ рдЧреЗрдо рд▓рд┐рдЦрд╛ рд╣реИ, рдЙрд╕реЗ рд▓рд┐рдирдХреНрд╕ рдпрд╛ рдУрдПрд╕рдПрдХреНрд╕ рдкрд░ рдЪрд▓рдиреЗ рд╡рд╛рд▓реЗ рдбрд┐рд╡рд╛рдЗрд╕ рдореЗрдВ рдЗрд╕реЗ рд╕реНрдерд╛рдирд╛рдВрддрд░рд┐рдд рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рдХреЛрдб рдХреА рдПрдХ рднреА рдкрдВрдХреНрддрд┐ рдХреЛ рдлрд┐рд░ рд╕реЗ рд▓рд┐рдЦрдиреЗ рдХреА рдЖрд╡рд╢реНрдпрдХрддрд╛ рдирд╣реАрдВ рд╣реИред

рд╕реНрдерд╛рдкрдирд╛


рдЪреВрдВрдХрд┐ рдпрд╣ рдкрд╛рда рд╢реБрд░реБрдЖрддреА рд▓реЛрдЧреЛрдВ рдХреЗ рд▓рд┐рдП рдмрдирд╛рдпрд╛ рдЧрдпрд╛ рд╣реИ, рд╣рдо рдЗрдВрдЬрди рдХреЛ рд╕реНрдерд╛рдкрд┐рдд рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рд╕рдмрд╕реЗ рд╕рд░рд▓ рддрд░реАрдХреЗ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░реЗрдВрдЧреЗред рдЗрд╕рдХреЗ рд▓рд┐рдП рд╣рдореЗрдВ рдХреЛрдб :: рдмреНрд▓реЙрдХреНрд╕ рдЪрд╛рд╣рд┐рдПред рдЗрд░рд┐рдХреНрд▓рд┐рдЪ рдмреНрд▓реЙрдХ рдХреЗ рдирд╡реАрдирддрдо рд╕рдВрд╕реНрдХрд░рдгреЛрдВ рдХреЗ рд╕рд╛рде рдмрд╣реБрдд рдЕрдиреБрдХреВрд▓ рдирд╣реАрдВ рд╣реИ, рдЗрд╕рд▓рд┐рдП рдпрд╣рд╛рдВ рд╕реЗ рдбрд╛рдЙрдирд▓реЛрдб рдХрд░реЗрдВ рдФрд░ рдкрд░реАрдХреНрд╖рдг рдХрд┐рдП рдЧрдП рд╕рдВрд╕реНрдХрд░рдг 10.05 рд╕реНрдерд╛рдкрд┐рдд рдХрд░реЗрдВред рдХреЛрдб :: рдмреНрд▓реЙрдХреЛрдВ рдореЗрдВ рдкрд╣рд▓реЗ рд╕реЗ рд╣реА рдЗрд╕рдХреЗ рдЗрдВрд╕реНрдЯреЙрд▓рд░ рдореЗрдВ рдПрдХ рдХрдВрдкрд╛рдЗрд▓рд░ рд╣реЛрддрд╛ рд╣реИ, рдЗрд╕рд▓рд┐рдП рдЖрдкрдХреЛ рдЗрд╕реЗ рдЕрд▓рдЧ рд╕реЗ рдбрд╛рдЙрдирд▓реЛрдб рдХрд░рдиреЗ рдХреА рдЖрд╡рд╢реНрдпрдХрддрд╛ рдирд╣реАрдВ рд╣реИред рдЗрд╕рдХреЗ рдмрд╛рдж, рд╣рдорд╛рд░реА рд╣рд╛рд░реНрдб рдбреНрд░рд╛рдЗрд╡ рдкрд░ рдПрдХ рдлрд╝реЛрд▓реНрдбрд░ рдмрдирд╛рдПрдВ рдЬрд╣рд╛рдВ рд╣рдорд╛рд░реА рдкрд░рд┐рдпреЛрдЬрдирд╛рдПрдВ рд╕рдВрдЧреНрд░рд╣реАрдд рд╣реЛрдВрдЧреА (рдореЗрд░реЗ рдкрд╛рд╕ "D: / IrrlichtDev" рд╣реИ)ред рдЕрдм рдЗрд░рд┐рдХреНрд▓рд┐рд╖реНрдЯ рдХрд╛ рдирд╡реАрдирддрдо рд╕рдВрд╕реНрдХрд░рдг рдпрд╣рд╛рдВ рд╕реЗ рдбрд╛рдЙрдирд▓реЛрдб рдХрд░реЗрдВ рдФрд░ рдЗрд╕реЗ рд╣рдорд╛рд░реЗ рджреНрд╡рд╛рд░рд╛ рдмрдирд╛рдИ рдЧрдИ рдирд┐рд░реНрджреЗрд╢рд┐рдХрд╛ рдореЗрдВ рдЕрдирдЬрд╝рд┐рдк рдХрд░реЗрдВ ред

рдкрд░рд┐рдпреЛрдЬрдирд╛ рдирд┐рд░реНрдорд╛рдг


рд╣рдорд╛рд░реЗ рдкрд╛рд╕ рдЖрдкрдХреА рдЬрд╝рд░реВрд░рдд рдХреА рд╣рд░ рдЪреАрдЬрд╝ рд╣реИ, рдкреНрд░реЛрдЬреЗрдХреНрдЯ рдмрдирд╛рдиреЗ рдХрд╛ рд╕рдордп рд╣реИред рд╣рдо рдХреЛрдб рдЦреЛрд▓рддреЗ рд╣реИрдВ: рдмреНрд▓реЙрдХ, рдЖрдЧреЗ "рдлрд╝рд╛рдЗрд▓> рдирдпрд╛> рдкреНрд░реЛрдЬреЗрдХреНрдЯ", рд╡рд╣рд╛рдВ рд╣рдо "рдЗрд░рд┐рдХреНрд▓рд┐рдкреНрдЯ рдкреНрд░реЛрдЬреЗрдХреНрдЯ" рдХрд╛ рдЪрдпрди рдХрд░рддреЗ рд╣реИрдВред рдирд┐рд░реНрджреЗрд╢реЛрдВ рдХрд╛ рдкрд╛рд▓рди рдХрд░рддреЗ рд╣реБрдП, рд╣рдо рдЕрдкрдиреА рдкрд░рд┐рдпреЛрдЬрдирд╛ рдХреЛ рдПрдХ рдирд╛рдо рдирд┐рд░реНрджрд┐рд╖реНрдЯ рдХрд░рддреЗ рд╣реИрдВ, рднрдВрдбрд╛рд░рдг рдХреЗ рд▓рд┐рдП рдирд┐рд░реНрджреЗрд╢рд┐рдХрд╛ рдХрд╛ рдЪрдпрди рдХрд░реЗрдВ, рд╕рдВрдХрд▓рдХ рдХреЗ рд░реВрдк рдореЗрдВ "рдЬреАрдПрдирдпреВ рдЬреАрд╕реАрд╕реА рдХрдВрдкрд╛рдЗрд▓рд░" рдирд┐рд░реНрджрд┐рд╖реНрдЯ рдХрд░реЗрдВ, рдФрд░, рдпрджрд┐ рдЕрдиреБрд░реЛрдз рдХрд┐рдпрд╛ рдЧрдпрд╛ рд╣реИ, рддреЛ рдХрд╣реЗрдВ рдХрд┐ рдЗрдВрдЬрди рдХрд╣рд╛рдБ рд╕реНрдерд┐рдд рд╣реИред

рдпрд╣реА рд╣реИ, рдкрд░рд┐рдпреЛрдЬрдирд╛ рдмрдирд╛рдИ рдЧрдИ рдереА, рдиреНрдпреВрдирддрдо рдХреЛрдб рд╕реНрд╡рдЪрд╛рд▓рд┐рдд рд░реВрдк рд╕реЗ рдЙрддреНрдкрдиреНрди рд╣реЛрддрд╛ рд╣реИ, рд▓реЗрдХрд┐рди рдпрджрд┐ рдЖрдк рдЗрд╕реЗ рд╕рдВрдХрд▓рд┐рдд рдХрд░рдиреЗ рдХрд╛ рдкреНрд░рдпрд╛рд╕ рдХрд░рддреЗ рд╣реИрдВ, рддреЛ рд╣рдореЗрдВ рдкреНрд░рддрд┐рдХреНрд░рд┐рдпрд╛ рдореЗрдВ 2 рддреНрд░реБрдЯрд┐рдпрд╛рдВ рдорд┐рд▓реЗрдВрдЧреАред рдпрд╣ рдареАрдХ рд╣реИ, рд╕рд┐рд░реНрдл weреж рдкрдВрдХреНрддрд┐ рдореЗрдВ рд╣рдо dimension2d dimension2du . , , .

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
рдкреНрд░рддрд┐рд╕реНрдерд╛рдкрд┐рдд dimension2d dimension2du . , , .

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
dimension2d dimension2du . , , .

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
 dimension2d  dimension2du . ,    ,     . 

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
dimension2d dimension2du . , , .

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
 dimension2d  dimension2du . ,    ,     . 

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
dimension2d dimension2du . , , .

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
 dimension2d  dimension2du . ,    ,     . 

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
dimension2d dimension2du . , , .

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
 dimension2d  dimension2du . ,    ,     . 

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
dimension2d dimension2du . , , .

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
 dimension2d  dimension2du . ,    ,     . 

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
dimension2d dimension2du . , , .

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
 dimension2d  dimension2du . ,    ,     . 

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
dimension2d dimension2du . , , .

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }
 dimension2d  dimension2du . ,    ,     . 

, Irrlicht. ( , ) :

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_SOFTWARE, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . while(device->run()) // . , . { driver->beginScene(true, true, SColor(0,200,200,200)); // . smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }

, . :

IMeshSceneNode * wall = smgr->addCubeSceneNode();

, , . , .
, , :

wall->setMaterialFlag(EMF_LIGHTING,false);

.
, , . :

wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); // "0" .

.
, ? :

wall->setRotation(wall->getRotation() + vector3df(0,1,0));

, .

, .
"i", , 256, . R, G B . , while :

while(device->run()) { int i; i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); driver->endScene(); }

, .
:

#include <irrlicht.h> using namespace irr; // using namespace core; // , , using namespace scene; // , using namespace video; // . using namespace io; // using namespace gui; // int main(int argc, char** argv) { IrrlichtDevice *device = // . createDevice(EDT_OPENGL, dimension2du(640, 480), 16, // 1- - . false, false, false, 0); // , EDT_OPENGL, . device->setWindowCaption(L"Hello HABRAHABR"); // . IVideoDriver* driver = device->getVideoDriver(); // . ISceneManager* smgr = device->getSceneManager(); // . smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); // . IMeshSceneNode * wall = smgr->addCubeSceneNode(); wall->setMaterialFlag(EMF_LIGHTING,false); wall->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); int i = 0; while(device->run()) // . , . { i++; if (i>256) i=0; driver->beginScene(true, true, SColor(0,i,i,i)); // . wall->setRotation(wall->getRotation() + vector3df(0,1,0)); smgr->drawAll(); // . driver->endScene(); // . } device->drop(); // , . return 0; }


Source: https://habr.com/ru/post/In191994/


All Articles