Jump to content
Posted 05 August 2012 - 11:22 AM
Posted 06 August 2012 - 04:24 AM
Vector3 NearScreenPoint = new Vector3(cx, cy, 0); Vector3 FarScreenPoint = new Vector3(cx, cy, 1);where cx and cy are the position in pixels referred to the current viewport (so take care of what is the current active viewport).
Direction = Vector3.Lerp(NearScreenPoint, FarScreenPoint, dist);where dist is a number in range [0..1] to choice the distance of your 3D object from the camera. If you use 0 or 1 you can't see the object, it's clipped away.
Edited by Koder4Fun, 06 August 2012 - 04:26 AM.
Posted 06 August 2012 - 02:08 PM
Posted 11 August 2012 - 04:33 AM
ComboMatrix = TranslationMatrix * ScaleMatrix * RotationMatrix;