D3d set projection ortho: Difference between revisions
Jump to navigation
Jump to search
FrogotoBot (talk | contribs) m (replacing function titles with notation using AWB) |
No edit summary |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{FuncTitle|d3d_set_projection_ortho|x,y,w,h,angle}} | {{FuncTitle|d3d_set_projection_ortho|x,y,w,h,angle}} | ||
== Description == | == Description == | ||
Sets the use of | Sets the use of an orthographic projection used with any further draw calls. The purpose of it is mainly for drawing your Heads-Up-Display (HUD) after your 3D projections as a layer on top of it, in which case you would also want to disable hidden surface removal to avoid "clipping" off parts of the hud. This basically is for a two dimensional projection with no perspective or convergence, what is used for the default rendering. | ||
== Parameters == | == Parameters == | ||
{| class="funcpars" | |||
! Parameter !! Data Type !! Description | |||
|- | |||
| x || double || x coordinate for the top left corner of the projection | |||
|- | |||
| y || double || y coordinate | |||
|- | |||
| w || double || width of the projection | |||
|- | |||
| h || double || height of the projection | |||
|- | |||
| angle || double || angle of the projection used for rotation | |||
|} | |||
== Return Values == | == Return Values == | ||
''' | '''void''': This function does not return anything. | ||
== Example Call == | == Example Call == | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="edl"> | ||
// demonstrates the use of drawing a 3D cube and then drawing some text on top of it | |||
d3d_set_projection_ortho(0, 0, view_wview[0], view_hview[0], 0); | d3d_set_projection_ortho(0, 0, view_wview[0], view_hview[0], 0); | ||
d3d_draw_block(50, 50, -50, 100, 100, 50, background_get_texture(bg_example), 1, 1); | d3d_draw_block(50, 50, -50, 100, 100, 50, background_get_texture(bg_example), 1, 1); | ||
Line 22: | Line 31: | ||
draw_text(50, 50, "Hello world!"); | draw_text(50, 50, "Hello world!"); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
__NOTOC__ | __NOTOC__ | ||
{{Function:GM}} | {{Function:GM}} |
Latest revision as of 18:04, 2 August 2014
Description
Sets the use of an orthographic projection used with any further draw calls. The purpose of it is mainly for drawing your Heads-Up-Display (HUD) after your 3D projections as a layer on top of it, in which case you would also want to disable hidden surface removal to avoid "clipping" off parts of the hud. This basically is for a two dimensional projection with no perspective or convergence, what is used for the default rendering.
Parameters
Parameter | Data Type | Description |
---|---|---|
x | double | x coordinate for the top left corner of the projection |
y | double | y coordinate |
w | double | width of the projection |
h | double | height of the projection |
angle | double | angle of the projection used for rotation |
Return Values
void: This function does not return anything.
Example Call
// demonstrates the use of drawing a 3D cube and then drawing some text on top of it
d3d_set_projection_ortho(0, 0, view_wview[0], view_hview[0], 0);
d3d_draw_block(50, 50, -50, 100, 100, 50, background_get_texture(bg_example), 1, 1);
// draw hud
d3d_set_hidden(false);
draw_text(50, 50, "Hello world!");