Posts

Showing posts from December, 2015

3.1.1: A Walk Through A View Part 2

Image
Last time, we created two types that will provide us the ability to simply some code that would other wise appear very dense and complex.  Generally, I have tried to write these tutorials in such a way that each step is broken down to be readily understandable and approachable regardless of ones programming background.  Moving objects or moving one's point of view through three dimensional space, involves very complex math.  Part 1 of this tutorial was an attempt to make the math concepts understandable for use here in Part 2 and onward. Utilizing Vector3 and Matrix4 In SwiftOpenGLView.swift of the OnTheMove project, add a few new variables to the SwiftOpenGLView class after the declaration of the others:  cameraPosition, cameraOrientation, the view matrix and the projection matrix. var cameraPosition = Vector3 (v0: 0.0 , v1: 0.0 , v2: - 5 .0 ) var cameraOrientation = Vector3 (v0: 0.0 , v1: 0.0 , v2: 0.0 ) private var view = Matrix4 () private var projection =