Hi, you can use the

calc_ray method from the camera.js module to do something like this. It uses canvas coordinates to cast a ray from this point in the 3d space. The main problem is that the 2-dimensional canvas coordinates don't give us full information about the point in 3d. You'll have a ray but you'll need to determine how far from the casting point you want the spot to be.

For example, if you want the spot to be 5 meters ahead of the current camera position:

var m_cam = require("camera");
var m_math = require("math");
var m_scenes = require("scenes");
var _ray_tmp = m_math.create_pline();
var _vec3_tmp = new Float32Array(3);
function get_3d_point(x, y) {
var camera = m_scenes.get_active_camera();
var ray = m_cam.calc_ray(camera, x, y, _ray_tmp);
// calculate the point 5 meters ahead of the camera in the ray direction
var point_3d = m_math.calc_pline_point(ray, 5, _vec3_tmp);
}

However, Blender seems to has a more complicated system than that. If there is an object under the cursor, when after the click the cursor "adheres" to this object at the intersection point between the "virtual" ray (cast from the mouse) and the object itself. There is a possibility to do that in blend4web via the special

append_ray_test method, but it works only for objects with physics - this means that you should manually set physics settings for all that objects in Blender, which can be very inconvenient.

You can see an example which illustrates the "append_ray_test" method here:

Ray Test.