Conventional 2D face recognition methods often struggle when a subject's head is turned even slightly to the side. In this study, a face recognition system based on 3D head modeling that is able to tolerate facial rotation angles was constructed by leveraging the Open source graphic library (OpenGL) framework. To minimize the extensive angle searching time that often occurs in conventional 3D modeling, Particle Swarm Optimization (PSO) was used to determine the correct facial angle in 3D. This reduced the angle computation time to 6 seconds, which is significantly faster than other methods. Experimental results showed that successful ID recognition can be achieved with a high recognition rate of 90%.