# 3D model editor manipulators

I'm trying to make my own 3D model editor to better learn 3D programming. I have my translate manipulators and I'm trying to calculate the Vector2 that the mouse would have to move in order to move an object down a specific axis. This will obviously change based on the position of the camera, position of the object and the axis. I have the majority of it working, I'm just not sure on how to finish it. If the camera is completely horizontal to the object then the values come out correct, but once I start to move the camera above or below the object the values start to get less accurate. I figure I need to incorporate the camera's up vector into it, but I'm not sure how.

The code snippet is for the X axis.

Vector3 meshCameraDistance = meshPosition - cameraPosition;
Vector3 angleAxis = new Vector3(1, 0, 0);

{
mouseDragDirection = new Vector3(-mouseDragDirection.x, mouseDragDirection.y);
}

speed = (manipulatorSpeed.x * mouseDragDirection.x) + (manipulatorSpeed.y * mouseDragDirection.y);