Converting coordinates of mouse to world units relative to a wall?


By casting a ray and using closest.getContactPoint(), we can obtain a (x,y,z) coordinate of a point.

Suppose that I know the (x,y,z) coordinate of a wall surface as well. I want to draw a box of length that fills the space between the two (x axis only. y ans z are fixed).
For that I need to make a box that will take the parameter in wu. How should I convert the difference in coordinates to world units and make a box at location

(x1+x2)/2 , y0, z0
y0 and z0 are fixed and known…

Secondly how should I change world unit to my appropriate scale.

I’m not sure I understand the question exactly… so I will throw out some random hints in case one sticks.

The contact point is already in world coordinates.

Otherwise… things like:,%20com.jme3.math.Vector3f)


Can be helpful.

I got this as well. Thanks…