0
\$\begingroup\$

I am working on a 3D tool for desktop and iPad. Everything is working fine except for two issues:

Issue 1 - When I select a 3D object with the mouse and move it on an iPad (as opposed to on desktop, where it works just fine), it doesn't move. (You can add cabinet by selecting the cabinet panel in right).

Issue 2 - I want to spawn and drag an object with the click of a button like this. With this tool, you can add an object by selecting and dragging it to the scene.

Thanks in advance. :)

\$\endgroup\$
2
  • \$\begingroup\$ What's your iOS version? WebGL is known not to work on iOS versions below 8. caniuse.com/#search=webgl \$\endgroup\$
    – ND523
    Oct 26, 2017 at 4:17
  • \$\begingroup\$ I have iOs version 10. \$\endgroup\$
    – Nishant
    Oct 26, 2017 at 5:29

1 Answer 1

0
\$\begingroup\$

To address Issue 1 - If raycasting works fine on desktop it should work fine on mobile (the THREE.js library/math code will be the same on each and runs without any sort of WebGL call as raycasting is done in the CPU in javascript).

I see though from the link that you're using touchmove which is correct but you're listening with your user creation function onDocumentMouseMove that reads event.clientX. This property doesn't look to be supported on iOS (See the compatibility table at the bottom).

It might be wise to use Hammer.js to normalize these events and properties into gestures for you or look into using a different property (like .pageX)

\$\endgroup\$
2
  • \$\begingroup\$ I have figured that out. i just have to detect the device and if it is a touch device then i have to use event.touches[0].page instead of event.client and it is working perfect. i'll definetly look into your suggestion. thanks for replying :) \$\endgroup\$
    – Nishant
    Dec 6, 2017 at 12:01
  • \$\begingroup\$ Hey @coburn can you help mw out with this issue? stackoverflow.com/questions/47280018/… \$\endgroup\$
    – Nishant
    Dec 6, 2017 at 12:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .