Rotate gameobject with mouse/touch similar to meshlab or other 3D softwear

I’ve been looking around the net but can’t find any examples of this (especially for Unity)?

There’s the usual:

float h = horizontalSpeed * Input.GetAxis("Mouse X");
float v = verticalSpeed * Input.GetAxis("Mouse Y");
transform.Rotate(v, -h, 0);

But this doesn’t give you accuracy when rotating a model in the way MeshLab or other 3D software wood.

I’ve tried to rotate GameObject based on collision point on mesh and origin with not much luck, and I would also like the rotation to work when the mouse/touch is not over the mesh, like MeshLab.

You can see the guy clicking around in MeshLab in this video and how the model is moving in relation to his mouse: MeshLab Features: Manipulator - YouTube

Any ideas/pointers to get this working in Unity?

I’ve just done a bit of work on rotating gameobjects, I think what I have done here should help - GitHub - WarmedxMints/Unity3d-PhysicsGun: Unity3d sample implementation of a Half-life 2 / Garry's mod Physics Gun