This is the code

POINT p; GetCursorPos(&p); p.x = max(min(p.x, 800), 0); p.y = max(min(p.y, 600), 0); float x = (p.x - 400) / 800.0f; float y = (p.y - 300) / 600.0f; D3DXVECTOR3 lookAt(x, 1.5f - y, -1.0f);

**Edited by Michael Tanczos, 24 December 2012 - 08:51 AM.**