Basic render 3D perspective projection onto 2D screen with camera (without opengl)

后端 未结 8 1029
南方客
南方客 2020-12-04 10:21

Let\'s say I have a data structure like the following:

Camera {
   double x, y, z

   /** ideally the camera angle is positioned to aim at the 0,0,0 point */         


        
8条回答
  •  难免孤独
    2020-12-04 10:39

    Converting points in 3D-space into a 2D point on a screen is simply made by using a matrix. Use a matrix to calculate the screen position of your point, this saves you a lot of work.

    When working with cameras you should consider using a look-at-matrix and multiply the look at matrix with your projection matrix.

提交回复
热议问题