Print at Mar 7, 2021, 6:01:34 AM

Posted by boe666 at Nov 21, 2018, 6:04:34 PM
Re: Export HTML5 plug-in
Please check my code. Why It not working well ?

Initialisation:

var HPC = viewHome("viewerCanvas", (... etc...));

//and the main function:
viewerCanvas.addEventListener("mouseup", function (e) {
console.log(e);
var rect = viewerCanvas.getBoundingClientRect();
var x = e.clientX; // - rect.left;
var y = e.clientY; // - rect.top;
console.log('mouse:' + x + ', ' + y);
var obj = HPC.getComponent3D().getClosestItemAt(x, y);
console.log(obj);

});


And console has this after click on the furniture (i have only one):

mouseup { target: canvas#viewerCanvas.viewerComponent
, buttons: 0, clientX: 390, clientY: 233, layerX: 390, layerY: 233 }
viewHome.html:114:8
mouse:390, 233 viewHome.html:118:8
null

always is NULL! Can somebody explain why ? What do i wrong ?