-3

I want to project a 2D screen point CGPoint(x, y) to 3D point(x, y, z), where z is not fixed. I learn from this website http://webglfactory.blogspot.com/2011/05/how-to-convert-world-to-screen.html, but the viewProjection matrix is 3*4. In arkit, the viewProjection matrix is 4*4. So when the inverse of viewProjection matrix multiply point(x, y), how to extend the point(x, y) to a 1*4 vector? Thanks a lot!!

Hui Ye
  • 1

1 Answers1

0

SCNView.unprojectPoint([x,y,depthInFrustum]) does what you want want. There's lots of examples with all the math for OpenGL if you lookup that method name.