Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

3DtoCamera

Drawing a pyramid using pure Core Graphics in Swift 3.0

Result

1234

Algorithm

It is necessary to calculate the coordinates of all verteces in the world coordinate system and then in the camera coordinate system. In order to do that, we need to multiply all 3 rotation matrices and the result matrix should be used for all verteces. New coordinates will be used for drawing. Z-coordinate will be used just for determination the distance from camera to the facet. And X,Y- coordinates for usual drawing in Cartesian coordinate system.

Another aspect is the calculation of the light intensity for each facet. Just calculate angle between the normal vectors and the light vector.

About

Drawing a pyramid using pure Core Graphics

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages