Ray, Node & Direction

Hello!



Before I express my question take a look at the following picture:





I control the brown cross with WiiMote and I want to be able to pick the figure of my choice (and then control it with the WiiMote).

The brown cross is a node (it is made by 2 boxes) and I according to the picking tutorial the Ray class needs the location and the direction. I have the location through getLocalTranslation() and the question is, how can I have the direction?

Α friend of mine helped me and with that code the problem seems solved



[java] Vector3f crossDirection = this.nm.getCross().getLocalTranslation();

Ray ray = new Ray(this.nm.getCross().getLocalTranslation(), new Vector3f(crossDirection.x, crossDirection.y, crossDirection.z-100));[/java]



and I was using the following code:

[java]

Vector3f crossDirection = this.nm.getCross().getLocalTranslation();

crossDirection.setZ(crossDirection.getZ()-100);

Ray ray = new Ray(this.nm.getCross().getLocalTranslation(), crossDirection);

[/java]