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!

Hi Avin!
I know this is an old topic and post but can you send the code for “057_ride_ball”, maybe placed in a playground?

Unfortunately; your source link above is broken and the github build isn’t creating an executable version on my Ubuntu server (page is blank).

Thanks in advance for your help!

Here it is:

3 Likes

That is really awesome! I will study it to try to make improvements (which will be nearly impossible but I can still try).

thank you

The sphere works great!

I have made some updates and learned a lot. 1 problem I am having - creating a handler to click any moving DOT and make camera follow (translate/zoom) with the dot on the sphere. Any suggestion how? I probably still misunderstand something important about the DOTs creation and controls.

Thanks in advance for your help