Horde3D http://www.horde3d.org/forums/ |
|
Node picking http://www.horde3d.org/forums/viewtopic.php?f=2&t=392 |
Page 1 of 1 |
Author: | cantele [ 04.07.2008, 12:31 ] |
Post subject: | Node picking |
1. I tried out node picking in the knight sample, and seems it works mostly, but when I aim at the knight's legs, I "hit" the knight where it's black, and do not hit it where it's visible. I wonder if this is a known issue or result of the engine design? I might note that I had stopped the animation while doing the picking. I used the utility function for picking nodes. I don't know what it's based on, probably some kind of ray casting. 2. Another related question: If I mess up with the geometry with a vertex shader, will it affect the picking negatively? I mean, if I move vertices or the projection, will I be able to pick the nodes *where they are rendered*? Is there some alternative strategy that would work (e.g. picking with framebuffer "colors" instead of ray casting...) |
Author: | Volker [ 04.07.2008, 12:54 ] |
Post subject: | Re: Node picking |
Picking is done based on the mesh data. Since the default way of doing skinning in Horde3D is hardware based, the picking does not consider the skinning. That may be the reason why you are not able to pick the knight's leg. You can see the real data used for the picking if you activate the debug mode. To allow picking with skinning you have to use the software skinning flag. |
Author: | newbie3D [ 15.07.2008, 11:11 ] |
Post subject: | Re: Node picking |
I'm looking for a function that return a NodeHandle from a node name, something like: NodeHandle manNode = Horde3D::findNodeFromName(RootNode, "Man", SceneNodeTypes::Undefined); In Horde3D, I don't find anything like this. I know Horde3D supports function findNodes to query array of nodes from a given name and function getNodeFindResult or getNodeChild to find a node from an index, but the problem is I don't know the index yet. Could anyone give me a solution? Thanks ![]() |
Author: | newbie3D [ 15.07.2008, 11:47 ] |
Post subject: | Re: Node picking |
I use Horde3D SceneEditor to create a Scene. The Scene contains a man with name "Man". In my code, I use: /* to find the Man node */ int manRet = Horde3D::findNodes(env, "Man", SceneNodeTypes::Undefined); /* then */ if (manRet == 1) { NodeHandle nhMan = Horde3D::getNodeFindResult(manIndex-1); } ... The above lines of code return nhMan = 9 (same as the ID in SceneEditor). But, when I use Horde3DUtils::pickNode to get the node, I have a different value return (32 exactly). Therefor I could not control the desired object. Could anyone explain this? Thanks |
Author: | newbie3D [ 15.07.2008, 12:02 ] |
Post subject: | Re: Node picking |
yeah, I see the point now. Just because the man mesh contains more children parts so the NodeHandles not match. Right after the Horde3DUtils::pickNode, I use Horde3D::getNodeParent to get the true node ![]() |
Author: | Volker [ 15.07.2008, 13:25 ] |
Post subject: | Re: Node picking |
See also: http://www.horde3d.org/forums/viewtopic.php?f=3&t=222&hilit=picknode |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |