d3d_vertex_normal_texture(x, y, z, nx, ny, nz, xtex, ytex)
Argument | Description |
---|---|
x | The x coordinate of the vertex. |
y | The y coordinate of the vertex. |
z | The z coordinate of the vertex. |
xn | The x component of the normal vector. |
yn | The y component of the normal vector. |
zn | The z component of the normal vector. |
xtex | Starting x coordinate within the texture (0 - 1). |
ytex | Starting y coordinate within the texture (0 - 1). |
Returns: N/A
This function defines the position of a vertex for a primitive,
assigns a normal to that vertex for the purposes of lighting and
then assigns a texture. The final look of the primitive will depend
on the primitive type chosen to draw, the order with which you add
the vertexes to it, and the normal that you define for it as well
as the lighting. See d3d_primitive_begin
for more information on primitives. To end and draw the primitive
you must call d3d_primitive_end.
var tex;
tex = background_get_texture(bck_Floor);
d3d_primitive_begin_texture(pr_trianglelist, tex);
d3d_vertex_normal_texture(-128, 0, -48, 0, 0.5, -0.5, 0, 0);
d3d_vertex_normal_texture(-128, 96, 48, 0, 0.5, -0.5, 1, 0);
d3d_vertex_normal_texture(128, 0, -48, 0, 0.5, -0.5, 0, 0.5);
d3d_vertex_normal_texture(128, 0, -48, 0, 0.5, -0.5, 1, 0.5);
d3d_vertex_normal_texture(-128, 96, 48, 0, 0.5, -0.5, 0, 1);
d3d_vertex_normal_texture(128, 96, 48, 0, 0.5, -0.5, 1, 1);
d3d_primitive_end();
The above code will draw a textured, sloped rectangle with the correct normal vectors for lighting.