can anyone can give an example of onover

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
moekkog
Posts: 44
Joined: Tue Feb 24, 2009 6:02 am

can anyone can give an example of onover

Post by moekkog »

for example i got a cube in a 3d space and i want , when i put the mouse pointer over the cube something happend like showing some text or an image can anyone can help me with a sample code or something and if its possible?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Check example 7. If you put the pointer on an animated model it changes its lighting property, on the level mesh the selected triangle is highlighted.
moekkog
Posts: 44
Joined: Tue Feb 24, 2009 6:02 am

yes but

Post by moekkog »

in the example they use the camera direction to identify de vector an draw a line to the object but what can i do if my camera is static
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

For example:

Code: Select all

core::position2d<s32> cursorpos = device->getCursorControl()->getPosition();
scene::ISceneNode* pickedNode = sceneManager->getSceneCollisionManager()->getSceneNodeFromScreenCoordinatesBB(cursorpos); 
You might also checkout the other functions of ISceneCollisionManager
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply