Horde3D

Next-Generation Graphics Engine
It is currently 02.05.2025, 19:39

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Node picking
PostPosted: 04.07.2008, 12:31 
Offline

Joined: 03.07.2008, 01:23
Posts: 50
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...)


Top
 Profile  
Reply with quote  
 Post subject: Re: Node picking
PostPosted: 04.07.2008, 12:54 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Node picking
PostPosted: 15.07.2008, 11:11 
Offline

Joined: 10.07.2008, 10:49
Posts: 20
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 :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Node picking
PostPosted: 15.07.2008, 11:47 
Offline

Joined: 10.07.2008, 10:49
Posts: 20
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Node picking
PostPosted: 15.07.2008, 12:02 
Offline

Joined: 10.07.2008, 10:49
Posts: 20
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 :lol:


Top
 Profile  
Reply with quote  
 Post subject: Re: Node picking
PostPosted: 15.07.2008, 13:25 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
See also: http://www.horde3d.org/forums/viewtopic.php?f=3&t=222&hilit=picknode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 94 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group