basic viewport calculation