Hello, I'm making a camera like in World of Warcraft: a camera always fixing the player SceneNode and rotate around it, with a mouse button to rotate the camera and the player SceneNode, another mouse button to only rotate the camera, and the wheel to zoom.
Except some details, my camera is functional. But I have a problem to manage the manual picking scene node (like in the 7th tutorial "collisions") with this camera. I tried a lot of things but it didn't work fine...
The known informations are the player scene node position, the camera position (with these two informations we can have the view direction), and the mouse cursor position on the window.
The problem is probably the 2D selection with the mouse cursor. I have to select a scene node in 3D, with a selection in 2D.
So, I'd like to know if you have a way to do that.
Thank you.
[Resolved]Manual scene node picking with a WOW-like camera
[Resolved]Manual scene node picking with a WOW-like camera
Last edited by benjani13 on Sat Sep 18, 2010 5:01 pm, edited 1 time in total.
Thank you very much! I can use this function for a ray/box detection:
And these for a ray/box and ray/triangle detection:
Code: Select all
pickedNode = collMan->getSceneNodeFromScreenCoordinatesBB(m_device->getCursorControl()->getPosition(), IDFlag_IsPickable);
Code: Select all
ray = collMan->getRayFromScreenCoordinates(m_device->getCursorControl()->getPosition(), camera);
pickedNode = collMan->getSceneNodeAndCollisionPointFromRay(ray, intersection, hitTriangle, IDFlag_IsPickable, 0);