Re: Export HTML5 plug-in
Code: Select all
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);
});