public Vector3f getWorldCoordinates(Vector2f screenPosition,
            float projectionZPos, Vector3f store) {
        if (store == null) {
            store = new Vector3f();
        }

        Matrix4f inverseMat = new Matrix4f(viewProjectionMatrix);
        inverseMat.invertLocal();

        store.set(
                (screenPosition.x / getWidth() - viewPortLeft) / (viewPortRight - viewPortLeft) * 2 - 1,
                (screenPosition.y / getHeight() - viewPortBottom) / (viewPortTop - viewPortBottom) * 2 - 1,
                projectionZPos * 2 - 1);

        float w = inverseMat.multProj(store, store);
        store.multLocal(1f / w);

        return store;
    }
Converts the given position from screen space to world space.

@param screenPosition a (2-D) location in screen space (not null)
@param projectionZPos a (non-linear) Z value in projection space
@param store storage for the result (modified if not null)
@return a location vector (in world coordinates, either
    <code>store</code> or a new vector)
@see Camera#getWorldCoordinates
jme3-core/src/main/java/com/jme3/renderer/Camera.java