Moving an item along the surface of a mesh using the keyboard or numeric input for (x,y)

Hello,
i need to be able to move a marker along the surface of a mesh without using the mouse.
With the mouse it was kind of easy, just using the scene.pick() method.
Now with the numeric / keyboard control this is a tad more difficult.
What I’d like to achieve is that the user can use two keys or numeric inputs to control the position in the 2D space which then gets translated to the meshes 3D space.
I have found this thread:

But I am not sure if there might be a different, simpler option which escapes me now.

Thanks!

I’ve made this here

https://avin.github.io/duck-paint/
(source)
select Drive mode here
image

and more simple version (but same logic) here

https://avin.github.io/generative/#/scene/057_ride_ball
(source)

May be it will help you :slight_smile:

4 Likes

Wow. This is pretty nifty!
Is there code somewhere to look at?

(source) + (source)

1 Like

Pretty slick how you’ve gotten the rotation of the Duck Race elements to correctly follow the shape of the duck as it curves in all 3 axis!