How to make the model rotate in the direction of the mouse

I have implemented a.STL model rotation, but it seems to rotate around the dots, and I want it to rotate in the direction of the mouse, such as pressing the left mouse button to slide from right to left on the page, and the model rotates from right to left.
my code is here.

Hello and welcome abroad! Can you put your code in a Playground so we can more easily see it?

I don’t know how to put it on the Playground. It’s my first time to contact babylon. May I study it

No problem, we’re here to help you learn! You can check the documentation here: Playground | Babylon.js Documentation (

1 Like