Raycast threejs touch event not working

I’ve been working on threejs mouse raycast with fabricjs, and it is working now here but the problem is the object didn’t move if i was using smartphone which is using touch. Should i create another event listener for touch event? or should it be working just fine using mouse event?

Pls help

Yes, mousedown only works with mouse inputs, if you want to capture the touch events from mobile you need touchstart, touchmove and touchend.

If you don’t want to add these, you can use pointerdown, pointermove and pointerup which capture both.

ok i’ll try it, but should i change new MouseEvent to new PointerEvent ?

https://codepen.io/naonvl/pen/ExbjejL it didn’t work, i dont know why but u’re right pointer should capture touch and mouse, could u pls give me an example?

I took a look at the codepen but I honestly have no idea why it doesn’t work. Maybe it has something to do with fabric.js? It’s very odd because just by logging the results, the two events seem to contain the same information. :thinking:

right? i implemented pointer event here 3D-TShirt-Design but it didn’t work since fabricjs didn’t support pointer event i believe

owayo football jerseys custom made in our 3D Designer - Football jersey designer - Printed football jerseys this is the reference for my project, i’ve inspect the js files, and it is using pointerdown do u think i should create a custom handler for that? pointer event still not working on fabricjs as i think

I’m trying to implement something similar myself. Have you found a way to show text that spans across multiple meshes?

have a look at this https://jersey-designer.netlify.app/

Yes I had look at but couldn’t work what technique was being used. Are the different colours made of separate meshes? I’ve noticed that the text doesn’t span the join for example where the front joins the back of the t-shirt

Actually i was using fabricjs canvas as texture of the 3d mesh. There is only 1 mesh with fabricjs canvas mapped as its texture. When i change the fabricjs objects, it reflect to the 3d mesh