Handbook
Glossary
draw-boid-gl3 ( boid -- )
Vocabulary
boids
Inputs
boid
an
object
Outputs
None
Definition
USING:
accessors
math
math.functions
opengl.gl
sequences
ui.render
;
IN:
boids
::
draw-boid-gl3
( boid -- )
boid
pos>>
first2
:>
( px py ) boid
vel>>
vec>rad
:>
angle
angle
cos
:>
c angle
sin
:>
s -6.0 c
*
4.0 s
*
-
px
+
:>
x1 -6.0 s
*
4.0 c
*
+
py
+
:>
y1 -6.0 c
*
-4.0 s
*
-
px
+
:>
x2 -6.0 s
*
-4.0 c
*
+
py
+
:>
y2 8.0 c
*
px
+
:>
x3 8.0 s
*
py
+
:>
y3
{
{
x1 y1
}
{
x2 y2
}
{
x3 y3
}
}
make-position-vertices
upload-vertices
GL_TRIANGLES
0 3
glDrawArrays
;