d3d_set_projection_ext(xfrom,yfrom,zfrom,xto,yto,zto,xup,yup,zup,angle,aspect,znear,zfar)

From ENIGMA

Jump to: navigation, search

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

Parameter Description
xfrom x coordinate of the vector the camera is looking from
yfrom y coordinate of the vector
zfrom z coordinate of the vector
xto x coordinate the camera is looking at in 3D space
yto y coordinate
zto z coordinate
xup x coordinate of the up normal, or the direction pointing up from where the camera is
yup y coordinate
zup z coordinate
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

void: This function does not return anything.

Example Call

// Demonstrates drawing a cube with an extended projection that will clip off half of the cube from being rendered.
d3d_set_projection_ext();
d3d_draw_block(-10, -10, -10, 10, 10, 10, background_get_texture(bg_example), 1, 1);
Personal tools
Namespaces
Variants
Actions
Navigation
ENIGMA
Other
Toolbox