improvements to generated export string (matches more closely to expected result)
This commit is contained in:
98
green.sml
98
green.sml
@@ -15,59 +15,59 @@ struct
|
||||
fun lerp (xOffset, yOffset, scale, windowWidth, windowHeight) =
|
||||
let
|
||||
val windowWidth = Real32.fromInt windowWidth
|
||||
val windowHeight = Real32.fromInt windowHeight
|
||||
val halfWidth = windowWidth / 2.0
|
||||
val windowHeight = Real32.fromInt windowHeight
|
||||
val halfHeight = windowHeight / 2.0
|
||||
in
|
||||
#[
|
||||
xToNdc (xOffset, 0.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 4.0, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.0, scale, halfWidth), 4.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 4.0, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.0, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.0, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.0, scale, halfWidth), 4.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 4.0, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.0, scale, halfWidth), 4.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.0, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 50.0, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.0, scale, halfWidth), 4.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 50.0, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 45.0, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 45.0, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.0, scale, halfWidth), 4.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 50.0, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.0, scale, halfWidth), 4.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 45.0, scale, halfHeight),
|
||||
xToNdc (xOffset, 45.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 4.0, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 45.0, scale, halfWidth), 49.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 4.0, scale, halfHeight),
|
||||
xToNdc (xOffset, 45.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.0, scale, halfHeight),
|
||||
xToNdc (xOffset, 45.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.0, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 45.0, scale, halfWidth), 49.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 4.0, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 45.0, scale, halfWidth), 49.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.0, scale, halfHeight),
|
||||
xToNdc (xOffset, 45.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 50.0, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 45.0, scale, halfWidth), 49.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 50.0, scale, halfHeight),
|
||||
xToNdc (xOffset, 45.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 45.0, scale, halfHeight),
|
||||
xToNdc (xOffset, 45.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 45.0, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 45.0, scale, halfWidth), 49.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 50.0, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 45.0, scale, halfWidth), 49.0, scale, halfWidth),
|
||||
yToNdc (yOffset, 45.0, scale, halfHeight)
|
||||
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 30.000000000000000, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.000000000000000, scale, halfWidth), 0.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 30.000000000000000, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.000000000000000, scale, halfWidth), 0.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 30.000000000000000, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.000000000000000, scale, halfWidth), 0.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.000000000000000, scale, halfWidth), 29.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.000000000000000, scale, halfWidth), 29.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.000000000000000, scale, halfWidth), 29.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 30.000000000000000, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.000000000000000, scale, halfWidth), 29.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 30.000000000000000, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 29.000000000000000, scale, halfHeight),
|
||||
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 29.000000000000000, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.000000000000000, scale, halfWidth), 29.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 30.000000000000000, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 0.000000000000000, scale, halfWidth), 29.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 29.000000000000000, scale, halfHeight),
|
||||
xToNdc (xOffset, 29.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 30.000000000000000, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 29.000000000000000, scale, halfWidth), 29.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 30.000000000000000, scale, halfHeight),
|
||||
xToNdc (xOffset, 29.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||
xToNdc (xOffset, 29.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 29.000000000000000, scale, halfWidth), 29.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 30.000000000000000, scale, halfHeight),
|
||||
endXToNdc (xOffset, xToNdc (xOffset, 29.000000000000000, scale, halfWidth), 29.000000000000000, scale, halfWidth),
|
||||
yToNdc (yOffset, 0.000000000000000, scale, halfHeight)
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user