[orx-fcurve] Add mfcurve, FCurve.min, FCurve.max, DemoFCurveSheet01.kt

This commit is contained in:
Edwin Jakobs
2024-05-13 08:30:05 +02:00
parent 968d544d3b
commit cc92dc26b2
6 changed files with 348 additions and 50 deletions

View File

@@ -1,7 +1,6 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.fcurve.fcurve
import org.openrndr.extra.parameters.ParameterType
import org.openrndr.math.Vector2
fun main() {
@@ -16,12 +15,11 @@ fun main() {
val yposCurve = fcurve("M360 h5")
val ypos = yposCurve.sampler()
extend {
drawer.circle(xpos(seconds.mod(5.0)), ypos(seconds.mod(5.0)), 100.0)
drawer.stroke = ColorRGBa.PINK
drawer.contours(xposCurve.contours(Vector2(720.0 / 5.0, 1.0)))
drawer.contours(yposCurve.contours(Vector2(720.0 / 5.0, 1.0)))
drawer.contours(xposCurve.contours(Vector2(720.0 / 5.0, -1.0), Vector2(0.0, height * 1.0)))
drawer.contours(yposCurve.contours(Vector2(720.0 / 5.0, -1.0), Vector2(0.0, height * 1.0)))
drawer.translate(seconds.mod(5.0)*(720.0/5.0), 0.0)
drawer.lineSegment(0.0, 0.0, 0.0, 720.0)
}