*EDITED* Raycasting line is not align with the mouse coursor, you have idea?


html text create an offset …

line 173 :smiley:
click in corner right :smiley:

EDIT UNDER /

solution it’s a alternative:

zRing.actionManager = new BABYLON.ActionManager(scene);

	//ON MOUSE ENTER
	zRing.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger, function(ev){	
		// mesh.material.emissiveColor = new BABYLON.Color3(0, 0, 1);
    zRing.material.diffuseColor = new BABYLON.Color3(0, 0, 1);
		// scene.hoverCursor = " url('http://jerome.bousquie.fr/BJS/test/viseur.png') 12 12, auto ";
	}));
	
	//ON MOUSE EXIT
	zRing.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger, function(ev){
		// mesh.material.emissiveColor = new BABYLON.Color3(1, 1, 1);
    zRing.material.diffuseColor = new BABYLON.Color3(1, 1, 1);
	}));

Hi,
I believe line 174 should read:

var pickResult = scene.pick(scene.pointerX, scene.pointerY);

instead of reading the client coordinates.
var pickResult = scene.pick(evt.clientX, evt.clientY);

I checked in your code and this works for me.

2 Likes

thanks <3