3D Projections

This section deals with the 3D projection functions.

Often in 3D games you want to change how you look at the world. For example, in a first person shooter you probably want to have the camera look from a position a bit above the xy-plane along the xy-plane, which, in graphics terms, involves setting the correct projection. This projection should be set in an instance that is created before all other instances (you can set this from the Instance Order window in the Room Editor), and it should be at a very low depth so that is drawn before all other instances in your room, otherwise you will get issues when drawing. NOTE When GameMaker starts drawing a room it will set the view point back to the default position, so the first thing you must do when drawing the scene is set is to the projection you want. This must be done in the draw event of an instance!

To change the way you look at the 3D world the following functions exist:

  1. d3d_set_projection
  2. d3d_set_projection_ext
  3. d3d_set_projection_ortho
  4. d3d_set_projection_perspective

Back: Working With 3D
Next: 3D Transformations
© Copyright YoYo Games Ltd. 2018 All Rights Reserved