Re: Export HTML5 plug-in

by boe666 » Wed Nov 21, 2018 6:04 pm

Please check my code. Why It not working well ?

Initialisation:

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);
							
							});

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 ?