Raycast guiNode

Hi i have some probs on casting ray in gui node this what i use :
Vector3f myVector2D = new Vector3f(inputManager.getCursorPosition().getX(),inputManager.getCursorPosition().getY(),0);
Vector3f myVector2Df = new Vector3f(0,0,1);
Ray myRay = new Ray(myVector2D, myVector2Df);
CollisionResults myResults = new CollisionResults();
MyGui.collideWith(myRay, myResults);
MyGui is bound to guiNode and works fine.
Seems when i cast ray i cant get exactly objects,they are more randomly hited,soo that must be some thing wrong in my ray casting . Any 1 know how to do a better ray casting in guiNode?

The gui node has a slightly different coordinate setup. X and Y are used for screen coords and Z is a kind of z-index similar to css. It behaves differently in quite a few specific circumstances, which you may come to reveal yourself in your endevours.

thnx but … cold u be more clear my english is a bit limited,and i actually cant get on how to “reveal” it?

He wants to know what you want to do.
All Three GUI libraries already handle clicking for you

i have to click on geometries instantieted in gui node soo i do get name and can do the rest,the problem is it do not hit with precision ,its like ray aint go exactly where i click

The problem is in the code we can’t see.

Put together a simple single class test case that illustrates the issue.

Or just use Lemur’s mouse picking support and be done with it.