below is the code for panning in OnMouseMove and onPaint - is there a better code I could use to do this in all directions - the one below isn’t very acurate - it is very difficult to move the object to where you want

case Obj1Select:
CSize translate = m_RightDownPos - point;
m_RightDownPos = point;
m_Obj1PanX +=;
m_Obj1PanY +=;
m_Obj1PanZ +=;

when drawing the object

glTranslated(m_Obj1PanX, 0,0);
glTranslated(0, m_Obj1PanY,0);
glTranslated(0, 0, m_Obj1PanZ);