Points
Points
¶
Points(
positions: Transform | Buffer,
sizes: Transform | Buffer | float,
fill_colors: Transform | Buffer | Color,
line_colors: Transform | Buffer | Color,
line_widths: Transform | Buffer | float,
)
Points are discs with a given size (diameter) and posses a surface that can be filled and stroked. They always face the viewer such that their rendered shape is a disc, independentely of any transform.
IN/OUT variables
// Rendering stage 1
in uniform vec4 viewport; // in("viewport")
in attribute [ vec2 | vec3 ] positions; // in("positions")
in [ attribute | uniform ] float sizes; // in("sizes")
in [ attribute | uniform ] vec4 fill_colors; // in("fill_colors")
in [ attribute | uniform ] vec4 line_colors; // in("line_colors")
in [ attribute | uniform ] vec4 line_widths; // in("line_widths")
// Rendering stage 2
out attribute vec3 screen; // out("screen[positions]")
// Rendering stage 3
out attribute float sizes; // out("sizes")
out attribute vec4 fill_colors; // out("fill_colors")
out attribute vec4 line_colors; // out("line_colors")
out attribute float line_widths; // out("line_widths")
Example
Create a visual of n points at given positions with given sizes, flll_colors., line_colors and line_widths.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
positions
|
Transform | Buffer
|
Points position (vec3) |
required |
sizes
|
Transform | Buffer | Measure
|
Point sizes (float) |
required |
fill_colors
|
Transform | Buffer | Color
|
Points fill colors (vec4) |
required |
line_colors
|
Transform | Buffer | Color
|
Points line colors (vec4) |
required |
line_widths
|
Transform | Buffer | Measure
|
Points line colors (vec4) |
required |
render
¶
Render the visual on viewport using the given model, view, proj matrices
Parameters:
Name | Type | Description | Default |
---|---|---|---|
viewport
|
Viewport
|
Viewport where to render the visual |
required |
model
|
Matrix
|
Model matrix to use for rendering |
None
|
view
|
Matrix
|
View matrix to use for rendering |
None
|
proj
|
Matrix
|
Projection matrix to use for rendering |
None
|