lazt omen
09/09/2020, 12:48 AMgroup {
minWidth = 400.0
minHeight = 400.0
var points = renderCube(GyroQuaternion("none", 0.25, 0.25, 0.25, -1.0))
println(points.size)
for (i in points)
println("${i.x} ${i.y}")
for (i in points.indices) {
if ((i + 1) % 4 != 0) {
line(points[i].x, points[i].y, points[i + 1].x, points[i + 1].y)
.addClass(Styles.lineStyle)
} else {
line(points[i].x, points[i].y, points[i - 3].x, points[i - 3].y)
.addClass(Styles.lineStyle)
}
}
subscribe<Events.EVENT_QUATERNION_READY> { event ->
val quat = event.quat
points = renderCube(GyroQuaternion(quat))
for (i in points)
println("${i.x} ${i.y}")
for (i in points.indices) {
if ((i + 1) % 4 != 0) {
line(points[i].x, points[i].y, points[i + 1].x, points[i + 1].y)
.addClass(Styles.lineStyle)
} else {
line(points[i].x, points[i].y, points[i - 3].x, points[i - 3].y)
.addClass(Styles.lineStyle)
}
}
}
}
tried using children.removeAll() and clear(). The first has no effect and the second just doesn't update the ui anymore