sidequestlegend/aframe-in-app-browser

want to ask about how you get the formula of mouse event?

spiritbroski opened this issue · 0 comments

so i also had a similiar approach with your code but instead of electron im using puppeteer, want to ask can you explain how to convert the coordinate in aframe into browser coordinate i have set my browser to 1080x640 but the mouse click is still wrong, i'm using your formula:

   let localPoint = this.el.object3D.worldToLocal(intersection.point);
            // Normalise the point in the range of the companion app resolution 1080X640
            let mouse = {
                x:((localPoint.x+(1.6/2))/1.6)*1080,
                // Invert the Y coordinate for top down orientation of the browser coordinates.
                y:640-(((localPoint.y+(0.9/2))/0.9)*640)
            };

the 1.6 is the width and the 0.9 is the height, really appreciate if you can help as this is a really helpful repo, also your discord invite link is invalid btw so i hope i can ask you in discord too