Yes, but i don't have enough skill yet to write that on my own..
What do i have to add for that to work, i just need to get the coordinates into a variable, i'll figure out the movement myself.
When someone clicks on "floor" scene node i want to get the position of click (the place where mouse has clicked in 3d space x,y,z coordinates) on that scene node and use it later to move "man" scene node there.
Will anyone do it, please?
Here is this simple code which i use for testing.
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")
IrrlichtDevice* device = 0;
int main()
{
device = createDevice(DT_OPENGL, dimension2d<s32>(800, 600), 32, false, false, 0);
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
IAnimatedMeshSceneNode* man = smgr->addAnimatedMeshSceneNode(smgr->getMesh("data/man.3ds"));
man->setPosition(vector3df(0,0,0));
IAnimatedMesh* floormesh = smgr->getMesh("data/floor.3ds");
ISceneNode* floor = 0;
if (floormesh)
floor = smgr->addOctTreeSceneNode(floormesh->getMesh(0));
if (floor)
floor->setPosition(vector3df(0,0,0));
smgr->addCameraSceneNode(0, vector3df(0,150,-150), vector3df(0,0,0));
while(device->run())
{
driver->beginScene(true, true, SColor(255,0,0,0));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}