#include "include/irrlicht.h" /* Some program =P Copyright (C) 2007 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* forward ref's */ IrrlichtDevice *device; video::IVideoDriver* driver; scene::ISceneManager* scenemgr; /* functions here */ ISceneNode* m3_modelload { IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2"); AnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); ~mesh; return node; } scene::ISceneNode* m3_setpos(ISceneNode* n, float x, float y, float z) { core::vector3df v; = //n->getPosition(); v.X = x v.Y = y v.Z = z n->setPosition(v); ~v; return n; } scene::ISceneNode* m3_setrot(ISceneNode* n, float x, float y, float z) { core::vector3df v; = //n->getRotation(); v.X = x v.Y = y v.Z = z n->setRotation(v); ~v; return n; } void m3_playanim(ISceneNode* node) { node->setFrameLoop(1,30*100); node->setAnimationSpeed(30*100); } // Start MAIN int main() { device = createDevice(video::EDT_OPENGL, core::dimension2d(640,480)); driver = device->getVideoDriver(); scenemgr = device->getSceneManager(); // load a model ISceneNode* mesh = m3_modelload ("model.x"); // rotate it m3_setrotation (mesh, 15, 15, 15); // add a camera cam = scenemgr->addCameraSceneNodeFPS(); // position our model m3_setpos (mesh, 0, 0, 13); // now animate it m3_playanim (mesh); while (device->run()) { } }