done converting coordinates to triangles for exporting (but I still need header and footer for that)
This commit is contained in:
@@ -12,14 +12,14 @@ struct
|
|||||||
, right, top
|
, right, top
|
||||||
]
|
]
|
||||||
|
|
||||||
fun ltrbToVertexRgb (left, top, right, bottom, r, g, b) =
|
fun ltrbToVertexRgb (startX, startY, endX, endY, r, g, b) =
|
||||||
#[ left, bottom, r, g, b
|
#[ startX, endY, r, g, b
|
||||||
, right, bottom, r, g, b
|
, endX, endY, r, g, b
|
||||||
, left, top, r, g, b
|
, startX, startY, r, g, b
|
||||||
|
|
||||||
, left, top, r, g, b
|
, startX, startY, r, g, b
|
||||||
, right, bottom, r, g, b
|
, endX, endY, r, g, b
|
||||||
, right, top, r, g, b
|
, endX, startY, r, g, b
|
||||||
]
|
]
|
||||||
|
|
||||||
fun fromPixelX (xpos, windowWidth, windowHeight) =
|
fun fromPixelX (xpos, windowWidth, windowHeight) =
|
||||||
|
|||||||
@@ -553,7 +553,15 @@ struct
|
|||||||
, ") - halfHeight) / halfHeight)"
|
, ") - halfHeight) / halfHeight)"
|
||||||
]
|
]
|
||||||
in
|
in
|
||||||
x :: y :: ex :: ex :: y :: ey :: r :: g :: b :: acc
|
(* based on triangle order formed by `Ndc.ltrbToVertexRgb` function *)
|
||||||
|
x :: ey :: r :: g :: b ::
|
||||||
|
ex :: ey :: r :: g :: b ::
|
||||||
|
x :: y :: r :: g :: b ::
|
||||||
|
|
||||||
|
x :: y :: r :: g :: b ::
|
||||||
|
ex :: ey :: r :: g :: b ::
|
||||||
|
ex :: y :: r :: g :: b ::
|
||||||
|
acc
|
||||||
end
|
end
|
||||||
|
|
||||||
fun toExportString (squares, canvasWidth, canvasHeight) =
|
fun toExportString (squares, canvasWidth, canvasHeight) =
|
||||||
|
|||||||
Reference in New Issue
Block a user