Jump to content

[solved] Touch events in browsers on device mobile


Celga
 Share

Recommended Posts

Hi,

I use the event pointermove on my canvas, in a application (web site), in which I import meshes with files .babylon.
These files have been created from 3ds max.
I have some difficulties to retrieve the picked mesh, especially when I pick these imported meshes.

In most cases, I'm not able to have a result, for the picked mesh.

The aim is to use touch events, in order to pick some interactive areas, revealing videos or other imported meshes, for a use of device mobile and tablets
For informations, the application works correctly, on pc, on several browsers.

Here is the function with the event pointermove :

canvas.addEventListener("pointermove", function(evt) {

        pickTouchResult = scene.pick(scene.pointerX, scene.pointerY);
        
        alert("Pointer MOVE (canvas)");
        alert(pickTouchResult.pickedMesh.name);
        
        alert("evt.pointerType : " + evt.pointerType);
    });

If you have some suggestions, I thank you in advance.

Link to comment
Share on other sites

Thanks a lot for your answer and for your advice.

Indeed, I used mesh.isPickable = true on the meshes imported. But, I only put it with the camera used for pc.
I changed my condition and It seems to be good, on tablet device. Meshes are picked correctly, with touch :)..

My mistake. Thanks again.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...