d3d_set_projection_ext - hpgDesigns/hpgdesigns-dev.io GitHub Wiki

NOTOC {{-}}

Notation

Description

Sets an extended 3D projection by appending 4 extra parameters to d3d_set_projection, allowing you to change the default field of view, aspect ratio, and near and far clipping planes.

Parameters

  • xfrom (xfrom,yfrom,zfrom) is the coordinate in 3D the camera is looking from
  • yfrom
  • zfrom
  • xto (xto,yto,zto) is the coordinate the camera is looking at in 3D space
  • yto
  • zto
  • xup (xup,yup,zup) create a directional "up" vector, or the direction pointing up from where the camera is standing
  • yup
  • zup
  • angle is the angle of the camera view in degrees, the human perception is about 60 degrees, some animals such as some fish can see 180 degrees, this is where the term "fisheye" originates, default is 45 degrees
  • aspect is the aspect ratio of the screen, usualy set to the width of your drawing area devided by the height, eg. view_wview[0]/view_hview[0], default is 4:3
  • znear the near plane of the projection or the depth after which pixels are allowed to copy to the screen, usually set to larger than or equal to 1 to avoid screwing up hidden surface removal
  • zfar the far plane of the projection or the depth after which pixels are no longer allowed to copy to the screen, default is 32000 meaning no pixel with a depth larger than then 32000 will be drawn

Return Values

No values are returned from the function.

Example Call

d3d_set_projection_ext();
d3d_draw_block(-10, -10, -10, 10, 10, 10, background_get_texture(bg_example), 1, 1);

Demonstrates drawing a cube with an extended projection that will clip off half of the cube from being rendered.

⚠️ **GitHub.com Fallback** ⚠️