Print at Dec 18, 2025, 1:03:52 AM

Posted by Puybaret at Dec 11, 2018, 11:16:41 AM
Re: Export HTML5 plug-in
I tried your program in Safari debugger and the object returned at the line
var obj = HPC.getComponent3D().getClosestItemAt(x, y);
was "almost" found. By "almost", I mean that your x,y coordinates are wrong, and you should translate them in canvas space, removing rect.x and rect.y (but rect can't be correct because you forgot brackets at the end of canvas.getBoundingClientRect).

You should really learn how to use a JavaScript debugger.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator