YoYo Games Wiki

D3d vertex color Test

From YoYoGames Wiki

Contents

d3d_vertex_color(x,y,z,col,alpha)

Description

This function adds a vertex to the primitive currently being drawn. It will be drawn with its own colour and alpha, specified in the function parameters.

Arguments

real x : x coordinate of the vertex to add

real y : y coordinate of the vertex to add

real z : z coordinate of the vertex to add

real col : colour of the point to be drawn

real alpha : alpha value of the point to be drawn

Return value

No value is returned

Examples

The following pice of code draws a simple partially transparent triangle in space with different colors on the vertices that are blended.

{
  d3d_primitive_begin(pr_trianglelist);
    d3d_vertex_color(100,100,0,c_red,128);
    d3d_vertex_color(100,200,0,c_blue,1);    
    d3d_vertex_color(150,150,200,c_green,1);
  d3d_primitive_end();
}

Remarks

The function is only available in the Pro Edition.

See Also