add [r, g, b] field to triangle, so we can draw coloured objects (next: add ability to change current colour)
This commit is contained in:
@@ -9,7 +9,7 @@ struct
|
||||
|
||||
fun helpToVector (lst, acc, windowWidth, windowHeight, halfWidth, halfHeight) =
|
||||
case lst of
|
||||
{x1, y1, x2, y2, x3, y3} :: tl =>
|
||||
{x1, y1, x2, y2, x3, y3, r, g, b} :: tl =>
|
||||
let
|
||||
val x1 = Ndc.centreAlignX (x1, windowWidth, windowHeight, halfWidth)
|
||||
val x2 = Ndc.centreAlignX (x2, windowWidth, windowHeight, halfWidth)
|
||||
@@ -22,10 +22,19 @@ struct
|
||||
val vec =
|
||||
#[ x1 / halfWidth
|
||||
, y1 / halfHeight
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
, x2 / halfWidth
|
||||
, y2 / halfHeight
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
, x3 / halfWidth
|
||||
, y3 / halfHeight
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
]
|
||||
val acc = vec :: acc
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user