Demos: ensure 720px wide, reduce indentation
openrndr-demos, orx-color, orx-jumpflood, orx-no-clear
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
|
|
||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.draw.loadImage
|
import org.openrndr.draw.loadImage
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
program {
|
program {
|
||||||
val image16 = loadImage("demo-data/images/16-bit.png")
|
val image16 = loadImage("demo-data/images/16-bit.png")
|
||||||
val image8 = loadImage("demo-data/images/image-001.png")
|
val image8 = loadImage("demo-data/images/image-001.png")
|
||||||
@@ -12,5 +10,4 @@ fun main() {
|
|||||||
drawer.image(image8, 320.0, 0.0)
|
drawer.image(image8, 320.0, 0.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.internal.colorBufferLoader
|
import org.openrndr.internal.colorBufferLoader
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
program {
|
program {
|
||||||
extend {
|
extend {
|
||||||
val proxy = colorBufferLoader.loadFromUrl("https://avatars3.githubusercontent.com/u/31103334?s=200&v=4")
|
val proxy = colorBufferLoader.loadFromUrl("https://avatars3.githubusercontent.com/u/31103334?s=200&v=4")
|
||||||
@@ -11,5 +10,4 @@ fun main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -11,14 +11,12 @@ import org.openrndr.math.Vector3
|
|||||||
|
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
|
||||||
configure {
|
configure {
|
||||||
multisample = WindowMultisample.SampleCount(8)
|
multisample = WindowMultisample.SampleCount(8)
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
extend(Orbital())
|
extend(Orbital())
|
||||||
|
|
||||||
|
|
||||||
val circlePositions = vertexBuffer(vertexFormat {
|
val circlePositions = vertexBuffer(vertexFormat {
|
||||||
attribute("position", VertexElementType.VECTOR3_FLOAT32)
|
attribute("position", VertexElementType.VECTOR3_FLOAT32)
|
||||||
attribute("scale", VertexElementType.FLOAT32)
|
attribute("scale", VertexElementType.FLOAT32)
|
||||||
@@ -31,7 +29,6 @@ fun main() = application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extend {
|
extend {
|
||||||
drawer.perspective(90.0, width*1.0/height*1.0, 0.1, 100.0)
|
drawer.perspective(90.0, width*1.0/height*1.0, 0.1, 100.0)
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ import org.openrndr.shape.ShapeContour
|
|||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
program {
|
program {
|
||||||
val points = List(6) { Polar(it * 70.0, 100.0).cartesian + drawer.bounds.center }
|
val points = List(6) {
|
||||||
|
Polar(it * 70.0, 100.0).cartesian + drawer.bounds.center
|
||||||
|
}
|
||||||
val cmr = CatmullRomChain2(points, 1.0, loop = true)
|
val cmr = CatmullRomChain2(points, 1.0, loop = true)
|
||||||
val contour = ShapeContour.fromPoints(cmr.positions(200), true)
|
val contour = ShapeContour.fromPoints(cmr.positions(200), true)
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ This program demonstrates dynamic circle batches
|
|||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
program {
|
program {
|
||||||
|
|
||||||
extend {
|
extend {
|
||||||
drawer.clear(ColorRGBa.GRAY)
|
drawer.clear(ColorRGBa.GRAY)
|
||||||
drawer.circles {
|
drawer.circles {
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ fun main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
program {
|
program {
|
||||||
|
|
||||||
val cs = Rectangle(0.0, 0.0, 200.0, 200.0).contour
|
val cs = Rectangle(0.0, 0.0, 200.0, 200.0).contour
|
||||||
val cc = Circle(100.0, 0.0, 100.0).contour
|
val cc = Circle(100.0, 0.0, 100.0).contour
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ import org.openrndr.shape.Circle
|
|||||||
import org.openrndr.shape.Rectangle
|
import org.openrndr.shape.Rectangle
|
||||||
import org.openrndr.shape.intersections
|
import org.openrndr.shape.intersections
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
program {
|
program {
|
||||||
extend {
|
extend {
|
||||||
val circle = Circle(mouse.position, 200.0).contour
|
val circle = Circle(mouse.position, 200.0).contour
|
||||||
@@ -16,7 +15,11 @@ fun main() {
|
|||||||
for (x in 50 until width step 100) {
|
for (x in 50 until width step 100) {
|
||||||
|
|
||||||
for (ring in 0 until 10) {
|
for (ring in 0 until 10) {
|
||||||
val r = Rectangle.fromCenter(Vector2(x * 1.0, y * 1.0), 90.0 - ring * 8.0, 90.0 - ring * 8.0).contour
|
val r = Rectangle.fromCenter(
|
||||||
|
Vector2(x * 1.0, y * 1.0),
|
||||||
|
90.0 - ring * 8.0,
|
||||||
|
90.0 - ring * 8.0
|
||||||
|
).contour
|
||||||
|
|
||||||
val ints = intersections(circle, r)
|
val ints = intersections(circle, r)
|
||||||
if (ints.isEmpty()) {
|
if (ints.isEmpty()) {
|
||||||
@@ -38,5 +41,4 @@ fun main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,17 @@
|
|||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.draw.*
|
import org.openrndr.draw.DrawPrimitive
|
||||||
|
import org.openrndr.draw.Session
|
||||||
|
import org.openrndr.draw.loadCubemap
|
||||||
|
import org.openrndr.draw.shadeStyle
|
||||||
import org.openrndr.extra.camera.Orbital
|
import org.openrndr.extra.camera.Orbital
|
||||||
import org.openrndr.extra.meshgenerators.boxMesh
|
import org.openrndr.extra.meshgenerators.boxMesh
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
program {
|
program {
|
||||||
|
|
||||||
val cubemap = loadCubemap("demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
|
val cubemap = loadCubemap("demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
|
||||||
val cube = boxMesh()
|
val cube = boxMesh()
|
||||||
extend(Orbital()) {
|
|
||||||
|
|
||||||
}
|
extend(Orbital())
|
||||||
extend {
|
extend {
|
||||||
drawer.shadeStyle = shadeStyle {
|
drawer.shadeStyle = shadeStyle {
|
||||||
fragmentTransform = """
|
fragmentTransform = """
|
||||||
|
|||||||
@@ -7,13 +7,17 @@ fun main() = application {
|
|||||||
program {
|
program {
|
||||||
val cubemap1 = loadCubemap("demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
|
val cubemap1 = loadCubemap("demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
|
||||||
val cube = boxMesh()
|
val cube = boxMesh()
|
||||||
val cubemap2 = cubemap(cubemap1.width, format = cubemap1.format, type = cubemap1.type, levels = 2, session = Session.active)
|
val cubemap2 = cubemap(
|
||||||
|
cubemap1.width,
|
||||||
|
format = cubemap1.format,
|
||||||
|
type = cubemap1.type,
|
||||||
|
levels = 2,
|
||||||
|
session = Session.active
|
||||||
|
)
|
||||||
cubemap1.copyTo(cubemap2, 0, 0)
|
cubemap1.copyTo(cubemap2, 0, 0)
|
||||||
cubemap2.generateMipmaps()
|
cubemap2.generateMipmaps()
|
||||||
|
|
||||||
extend(Orbital()) {
|
extend(Orbital())
|
||||||
|
|
||||||
}
|
|
||||||
extend {
|
extend {
|
||||||
drawer.shadeStyle = shadeStyle {
|
drawer.shadeStyle = shadeStyle {
|
||||||
fragmentTransform = """
|
fragmentTransform = """
|
||||||
|
|||||||
@@ -7,7 +7,13 @@ fun main() = application {
|
|||||||
program {
|
program {
|
||||||
val cubemap1 = loadCubemap("demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
|
val cubemap1 = loadCubemap("demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
|
||||||
val cube = boxMesh()
|
val cube = boxMesh()
|
||||||
val cubemap2 = cubemap(cubemap1.width, format = cubemap1.format, type = cubemap1.type, levels = 2, session = Session.active)
|
val cubemap2 = cubemap(
|
||||||
|
cubemap1.width,
|
||||||
|
format = cubemap1.format,
|
||||||
|
type = cubemap1.type,
|
||||||
|
levels = 2,
|
||||||
|
session = Session.active
|
||||||
|
)
|
||||||
cubemap1.copyTo(cubemap2, 0, 0)
|
cubemap1.copyTo(cubemap2, 0, 0)
|
||||||
cubemap2.generateMipmaps()
|
cubemap2.generateMipmaps()
|
||||||
|
|
||||||
@@ -18,9 +24,7 @@ fun main() = application {
|
|||||||
|
|
||||||
cma.generateMipmaps()
|
cma.generateMipmaps()
|
||||||
|
|
||||||
extend(Orbital()) {
|
extend(Orbital())
|
||||||
|
|
||||||
}
|
|
||||||
extend {
|
extend {
|
||||||
drawer.shadeStyle = shadeStyle {
|
drawer.shadeStyle = shadeStyle {
|
||||||
fragmentTransform = """
|
fragmentTransform = """
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.draw.loadImage
|
import org.openrndr.draw.loadImage
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
program {
|
program {
|
||||||
val image = loadImage("demo-data/images/image-001.dds")
|
val image = loadImage("demo-data/images/image-001.dds")
|
||||||
println(image.format)
|
println(image.format)
|
||||||
@@ -11,5 +10,4 @@ fun main() {
|
|||||||
drawer.image(image)
|
drawer.image(image)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,7 @@ import org.openrndr.extra.camera.Orbital
|
|||||||
import org.openrndr.extra.meshgenerators.boxMesh
|
import org.openrndr.extra.meshgenerators.boxMesh
|
||||||
import org.openrndr.resourceText
|
import org.openrndr.resourceText
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
program {
|
program {
|
||||||
val vb = boxMesh()
|
val vb = boxMesh()
|
||||||
val shader = Shader.createFromCode(
|
val shader = Shader.createFromCode(
|
||||||
@@ -28,5 +27,4 @@ fun main() {
|
|||||||
shader.end()
|
shader.end()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -5,12 +5,11 @@ import org.openrndr.extra.meshgenerators.planeMesh
|
|||||||
import org.openrndr.internal.Driver
|
import org.openrndr.internal.Driver
|
||||||
import org.openrndr.math.Vector3
|
import org.openrndr.math.Vector3
|
||||||
|
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
program {
|
program {
|
||||||
|
val shader = Shader.createFromCode(
|
||||||
val shader = Shader.createFromCode(vsCode =
|
vsCode =
|
||||||
"""${Driver.instance.shaderConfiguration()}
|
"""${Driver.instance.shaderConfiguration(ShaderType.VERTEX)}
|
||||||
in vec3 a_position;
|
in vec3 a_position;
|
||||||
in vec2 a_texCoord0;
|
in vec2 a_texCoord0;
|
||||||
in vec3 a_normal;
|
in vec3 a_normal;
|
||||||
@@ -21,14 +20,15 @@ void main() {
|
|||||||
gl_Position = projMatrix * vec4(a_position, 1.0);
|
gl_Position = projMatrix * vec4(a_position, 1.0);
|
||||||
}
|
}
|
||||||
""",
|
""",
|
||||||
fsCode = """${Driver.instance.shaderConfiguration()}
|
fsCode = """${Driver.instance.shaderConfiguration(ShaderType.FRAGMENT)}
|
||||||
out vec4 o_color;
|
out vec4 o_color;
|
||||||
layout(rgba8) uniform writeonly image2D bla;
|
layout(rgba8) uniform writeonly image2D bla;
|
||||||
void main() {
|
void main() {
|
||||||
imageStore(bla, ivec2(30,30), vec4(1.0, 0.0, 0.0, 1.0));
|
imageStore(bla, ivec2(30,30), vec4(1.0, 0.0, 0.0, 1.0));
|
||||||
o_color = vec4(1.0);
|
o_color = vec4(1.0);
|
||||||
}
|
}
|
||||||
""", name = "ils")
|
""", name = "ils"
|
||||||
|
)
|
||||||
val cb = colorBuffer(128, 128, type = ColorType.UINT8)
|
val cb = colorBuffer(128, 128, type = ColorType.UINT8)
|
||||||
val mesh = planeMesh(Vector3.ZERO, Vector3.UNIT_X, Vector3.UNIT_Y, -Vector3.UNIT_Z, 100.0, 100.0)
|
val mesh = planeMesh(Vector3.ZERO, Vector3.UNIT_X, Vector3.UNIT_Y, -Vector3.UNIT_Z, 100.0, 100.0)
|
||||||
|
|
||||||
@@ -44,6 +44,5 @@ void main() {
|
|||||||
drawer.clear(ColorRGBa.BLACK)
|
drawer.clear(ColorRGBa.BLACK)
|
||||||
drawer.image(cb)
|
drawer.image(cb)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@ import org.openrndr.application
|
|||||||
import org.openrndr.color.ColorRGBa
|
import org.openrndr.color.ColorRGBa
|
||||||
import org.openrndr.draw.*
|
import org.openrndr.draw.*
|
||||||
|
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
program {
|
program {
|
||||||
val cb = colorBuffer(128, 128, type = ColorType.UINT8)
|
val cb = colorBuffer(128, 128, type = ColorType.UINT8)
|
||||||
@@ -15,7 +14,6 @@ fun main() = application {
|
|||||||
image("image", cb.imageBinding(0, ImageAccess.WRITE))
|
image("image", cb.imageBinding(0, ImageAccess.WRITE))
|
||||||
}
|
}
|
||||||
extend {
|
extend {
|
||||||
|
|
||||||
drawer.shadeStyle = ss
|
drawer.shadeStyle = ss
|
||||||
drawer.clear(ColorRGBa.PINK)
|
drawer.clear(ColorRGBa.PINK)
|
||||||
drawer.rectangle(0.0, 0.0, 100.0, 100.0)
|
drawer.rectangle(0.0, 0.0, 100.0, 100.0)
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.color.ColorRGBa
|
import org.openrndr.color.rgb
|
||||||
import org.openrndr.draw.*
|
import org.openrndr.draw.*
|
||||||
|
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
program {
|
program {
|
||||||
val cb = colorBuffer(128, 128)
|
val cb = colorBuffer(128, 128, type = ColorType.UINT8)
|
||||||
val at = arrayTexture(128, 128, 32)
|
val at = arrayTexture(128, 128, 32, type = ColorType.UINT8)
|
||||||
val vt = volumeTexture(32, 32, 32)
|
val vt = volumeTexture(32, 32, 32, type = ColorType.UINT8)
|
||||||
extend {
|
extend {
|
||||||
val ss = shadeStyle {
|
val ss = shadeStyle {
|
||||||
fragmentTransform = """
|
fragmentTransform = """
|
||||||
@@ -16,12 +15,13 @@ fun main() = application {
|
|||||||
imageStore(p_at, ivec3(2, 2, 2), vec4(1.0, 0.0, 0.0, 1.0));
|
imageStore(p_at, ivec3(2, 2, 2), vec4(1.0, 0.0, 0.0, 1.0));
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
parameter("at", at.imageBinding(0, ImageAccess.READ_WRITE))
|
image("at", at.imageBinding(0, ImageAccess.READ_WRITE))
|
||||||
parameter("image", cb.imageBinding(0, ImageAccess.READ_WRITE))
|
image("image", cb.imageBinding(0, ImageAccess.READ_WRITE))
|
||||||
parameter("vt", vt.imageBinding(0, ImageAccess.READ_WRITE))
|
image("vt", vt.imageBinding(0, ImageAccess.READ_WRITE))
|
||||||
}
|
}
|
||||||
drawer.shadeStyle = ss
|
drawer.shadeStyle = ss
|
||||||
drawer.clear(ColorRGBa.PINK)
|
drawer.clear(rgb(0.1))
|
||||||
|
drawer.fill = rgb(0.2)
|
||||||
drawer.rectangle(0.0, 0.0, 100.0, 100.0)
|
drawer.rectangle(0.0, 0.0, 100.0, 100.0)
|
||||||
drawer.image(cb, 0.0, 200.0)
|
drawer.image(cb, 0.0, 200.0)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ fun main() {
|
|||||||
stroke = ColorRGBa.PINK
|
stroke = ColorRGBa.PINK
|
||||||
strokeWeight = 8.0
|
strokeWeight = 8.0
|
||||||
fontMap = font
|
fontMap = font
|
||||||
LineCap.values().forEachIndexed { x, cap ->
|
LineCap.entries.forEachIndexed { x, cap ->
|
||||||
lineCap = cap
|
lineCap = cap
|
||||||
LineJoin.values().forEachIndexed { y, join ->
|
LineJoin.entries.forEachIndexed { y, join ->
|
||||||
lineJoin = join
|
lineJoin = join
|
||||||
val pos = IntVector2(x - 1, y - 1).vector2 * 180.0
|
val pos = IntVector2(x - 1, y - 1).vector2 * 180.0
|
||||||
isolated {
|
isolated {
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ fun main() = application {
|
|||||||
program {
|
program {
|
||||||
val style = shadeStyle {
|
val style = shadeStyle {
|
||||||
//fragmentTransform = "x_stroke.a *= step(0.5, fract(c_contourPosition / p_dashLen));"
|
//fragmentTransform = "x_stroke.a *= step(0.5, fract(c_contourPosition / p_dashLen));"
|
||||||
fragmentTransform = "x_stroke.a *= smoothstep(0.0, 1.0, mod(c_contourPosition, p_dashLen)) * smoothstep(p_dashLen, p_dashLen-1.0, mod(c_contourPosition, p_dashLen));"
|
fragmentTransform =
|
||||||
|
"x_stroke.a *= smoothstep(0.0, 1.0, mod(c_contourPosition, p_dashLen)) * smoothstep(p_dashLen, p_dashLen-1.0, mod(c_contourPosition, p_dashLen));"
|
||||||
parameter("dashLen", 20.0)
|
parameter("dashLen", 20.0)
|
||||||
}
|
}
|
||||||
extend {
|
extend {
|
||||||
@@ -25,8 +26,7 @@ fun main() = application {
|
|||||||
shadeStyle = style
|
shadeStyle = style
|
||||||
contour(c)
|
contour(c)
|
||||||
|
|
||||||
drawer.lineSegment(0.0, 0.0, width*1.0, height*1.0)
|
drawer.lineSegment(0.0, 0.0, width * 1.0, height * 1.0)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ import org.openrndr.extra.meshgenerators.boxMesh
|
|||||||
import org.openrndr.ffmpeg.VideoPlayerFFMPEG
|
import org.openrndr.ffmpeg.VideoPlayerFFMPEG
|
||||||
import org.openrndr.math.Vector3
|
import org.openrndr.math.Vector3
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
program {
|
program {
|
||||||
val cube = boxMesh()
|
val cube = boxMesh()
|
||||||
val screen = VideoPlayerFFMPEG.fromScreen(
|
val screen = VideoPlayerFFMPEG.fromScreen(
|
||||||
@@ -40,5 +39,4 @@ fun main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.draw.*
|
import org.openrndr.draw.BufferPrimitiveType
|
||||||
|
import org.openrndr.draw.shadeStyle
|
||||||
|
import org.openrndr.draw.shaderStorageBuffer
|
||||||
|
import org.openrndr.draw.shaderStorageFormat
|
||||||
import java.nio.ByteBuffer
|
import java.nio.ByteBuffer
|
||||||
import java.nio.ByteOrder
|
import java.nio.ByteOrder
|
||||||
|
|
||||||
@@ -46,6 +49,5 @@ fun main() = application {
|
|||||||
// Therefore the value of `f1` can vary from frame to frame,
|
// Therefore the value of `f1` can vary from frame to frame,
|
||||||
// because we don't know how many times `+= 2.0` was executed.
|
// because we don't know how many times `+= 2.0` was executed.
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,8 +7,7 @@ import org.openrndr.draw.vertexFormat
|
|||||||
import org.openrndr.math.Vector3
|
import org.openrndr.math.Vector3
|
||||||
import org.openrndr.resourceText
|
import org.openrndr.resourceText
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
program {
|
program {
|
||||||
val vb = vertexBuffer(vertexFormat {
|
val vb = vertexBuffer(vertexFormat {
|
||||||
position(3)
|
position(3)
|
||||||
@@ -48,5 +47,4 @@ fun main() {
|
|||||||
shader.end()
|
shader.end()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -7,10 +7,9 @@ import org.openrndr.draw.vertexFormat
|
|||||||
import org.openrndr.resourceText
|
import org.openrndr.resourceText
|
||||||
import org.openrndr.shape.Ellipse
|
import org.openrndr.shape.Ellipse
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
program {
|
program {
|
||||||
val ellipse = Ellipse(width/2.0, height/2.0, 100.0, 300.0).contour
|
val ellipse = Ellipse(width / 2.0, height / 2.0, 100.0, 300.0).contour
|
||||||
|
|
||||||
val vb = vertexBuffer(vertexFormat {
|
val vb = vertexBuffer(vertexFormat {
|
||||||
position(3)
|
position(3)
|
||||||
@@ -47,5 +46,4 @@ fun main() {
|
|||||||
shader.end()
|
shader.end()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -7,11 +7,10 @@ import org.openrndr.draw.vertexFormat
|
|||||||
import org.openrndr.resourceText
|
import org.openrndr.resourceText
|
||||||
import org.openrndr.shape.Ellipse
|
import org.openrndr.shape.Ellipse
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
program {
|
program {
|
||||||
|
|
||||||
val ellipse = Ellipse(width/2.0, height/2.0, 100.0, 200.0).contour
|
val ellipse = Ellipse(width / 2.0, height / 2.0, 100.0, 200.0).contour
|
||||||
|
|
||||||
val vb = vertexBuffer(vertexFormat {
|
val vb = vertexBuffer(vertexFormat {
|
||||||
position(3)
|
position(3)
|
||||||
@@ -38,9 +37,9 @@ fun main() {
|
|||||||
|
|
||||||
extend {
|
extend {
|
||||||
drawer.clear(ColorRGBa.PINK)
|
drawer.clear(ColorRGBa.PINK)
|
||||||
drawer.translate(width/2.0, height/2.0, 0.0)
|
drawer.translate(width / 2.0, height / 2.0, 0.0)
|
||||||
drawer.rotate(seconds*45.0)
|
drawer.rotate(seconds * 45.0)
|
||||||
drawer.translate(-width/2.0, -height/2.0, 0.0)
|
drawer.translate(-width / 2.0, -height / 2.0, 0.0)
|
||||||
|
|
||||||
shader.begin()
|
shader.begin()
|
||||||
shader.uniform("offset", mouse.position.xy0)
|
shader.uniform("offset", mouse.position.xy0)
|
||||||
@@ -48,10 +47,9 @@ fun main() {
|
|||||||
shader.uniform("proj", drawer.projection)
|
shader.uniform("proj", drawer.projection)
|
||||||
shader.uniform("model", drawer.model)
|
shader.uniform("model", drawer.model)
|
||||||
shader.uniform("resolution", ((mouse.position.x / width) * 63 + 1).toInt())
|
shader.uniform("resolution", ((mouse.position.x / width) * 63 + 1).toInt())
|
||||||
shader.uniform("weight",((mouse.position.y / height) * 128 + 1) )
|
shader.uniform("weight", ((mouse.position.y / height) * 128 + 1))
|
||||||
driver.drawVertexBuffer(shader, listOf(vb), DrawPrimitive.PATCHES, 0, vb.vertexCount)
|
driver.drawVertexBuffer(shader, listOf(vb), DrawPrimitive.PATCHES, 0, vb.vertexCount)
|
||||||
shader.end()
|
shader.end()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,28 +1,23 @@
|
|||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.color.ColorRGBa
|
import org.openrndr.color.ColorRGBa
|
||||||
import org.openrndr.draw.*
|
import org.openrndr.draw.*
|
||||||
import org.openrndr.extra.noise.uniform
|
|
||||||
import org.openrndr.extra.noise.uniformRing
|
|
||||||
import org.openrndr.extra.camera.Orbital
|
import org.openrndr.extra.camera.Orbital
|
||||||
import org.openrndr.extra.camera.OrbitalCamera
|
|
||||||
import org.openrndr.extra.meshgenerators.sphereMesh
|
import org.openrndr.extra.meshgenerators.sphereMesh
|
||||||
|
import org.openrndr.extra.noise.uniformRing
|
||||||
|
import org.openrndr.extra.shaderphrases.preprocessedFromUrls
|
||||||
import org.openrndr.math.Vector3
|
import org.openrndr.math.Vector3
|
||||||
import org.openrndr.resourceUrl
|
import org.openrndr.resourceUrl
|
||||||
import org.openrndr.shape.Ellipse
|
|
||||||
import org.openrndr.shape.path3D
|
import org.openrndr.shape.path3D
|
||||||
|
|
||||||
import org.openrndr.extra.shaderphrases.preprocessedFromUrls
|
|
||||||
import kotlin.math.cos
|
import kotlin.math.cos
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
program {
|
program {
|
||||||
extend(Orbital())
|
extend(Orbital())
|
||||||
|
|
||||||
val path = path3D {
|
val path = path3D {
|
||||||
moveTo(Vector3.ZERO)
|
moveTo(Vector3.ZERO)
|
||||||
for (i in 0 until 100) {
|
for (i in 0 until 100) {
|
||||||
continueTo(anchor + Vector3.uniformRing(0.0, 10.0),anchor + Vector3.uniformRing(0.0, 10.0))
|
continueTo(anchor + Vector3.uniformRing(0.0, 10.0), anchor + Vector3.uniformRing(0.0, 10.0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val vb = vertexBuffer(vertexFormat {
|
val vb = vertexBuffer(vertexFormat {
|
||||||
@@ -40,7 +35,7 @@ fun main() {
|
|||||||
val mesh = sphereMesh()
|
val mesh = sphereMesh()
|
||||||
extend {
|
extend {
|
||||||
val vc = vb.put {
|
val vc = vb.put {
|
||||||
for (segment in path.sub(0.0, cos(seconds*0.1)*0.5+ 0.5).segments) {
|
for (segment in path.sub(0.0, cos(seconds * 0.1) * 0.5 + 0.5).segments) {
|
||||||
val cubic = segment.cubic
|
val cubic = segment.cubic
|
||||||
write(cubic.start)
|
write(cubic.start)
|
||||||
write(cubic.control[0])
|
write(cubic.control[0])
|
||||||
@@ -60,7 +55,7 @@ fun main() {
|
|||||||
shader.uniform("model", drawer.model)
|
shader.uniform("model", drawer.model)
|
||||||
shader.uniform("resolution", 32)
|
shader.uniform("resolution", 32)
|
||||||
shader.uniform("weight", 3.0 + cos(seconds))
|
shader.uniform("weight", 3.0 + cos(seconds))
|
||||||
shader.uniform("time", seconds*0.0)
|
shader.uniform("time", seconds * 0.0)
|
||||||
drawer.depthWrite = false
|
drawer.depthWrite = false
|
||||||
|
|
||||||
driver.setState(drawer.drawStyle)
|
driver.setState(drawer.drawStyle)
|
||||||
@@ -69,5 +64,4 @@ fun main() {
|
|||||||
drawer.fill = ColorRGBa.WHITE
|
drawer.fill = ColorRGBa.WHITE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@ import org.openrndr.draw.*
|
|||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
program {
|
program {
|
||||||
val volumeTexture = VolumeTexture.create(128,128,32, type = ColorType.UINT8)
|
val volumeTexture = VolumeTexture.create(128, 128, 32, type = ColorType.UINT8)
|
||||||
val rt = renderTarget(128, 128) {
|
val rt = renderTarget(128, 128) {
|
||||||
volumeTexture(volumeTexture, 0)
|
volumeTexture(volumeTexture, 0)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,9 +31,11 @@ fun main() = application {
|
|||||||
|
|
||||||
// Rectangles with the bottom right corner centered in the window
|
// Rectangles with the bottom right corner centered in the window
|
||||||
drawer.rectangles(List(10) {
|
drawer.rectangles(List(10) {
|
||||||
Rectangle(drawer.bounds.center,
|
Rectangle(
|
||||||
|
drawer.bounds.center,
|
||||||
-squareSize * 2 + it * 10,
|
-squareSize * 2 + it * 10,
|
||||||
-squareSize * 2 + it * 10)
|
-squareSize * 2 + it * 10
|
||||||
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,9 @@ fun main() = application {
|
|||||||
drawer.stroke = ColorRGBa.WHITE
|
drawer.stroke = ColorRGBa.WHITE
|
||||||
drawer.strokeWeight = 2.0
|
drawer.strokeWeight = 2.0
|
||||||
drawer.rectangles {
|
drawer.rectangles {
|
||||||
for (y in 0 until height/20) {
|
for (y in 0 until height / 20) {
|
||||||
for (x in 0 until width/20) {
|
for (x in 0 until width / 20) {
|
||||||
rectangle(x * 20.0, y * 20.0, 10.0, 15.0, (x + y) * 10.0 + seconds*90.0)
|
rectangle(x * 20.0, y * 20.0, 10.0, 15.0, (x + y) * 10.0 + seconds * 90.0)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,56 @@ for (c in cs blend (width / 40)) {
|
|||||||
Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an implementation of the colorspaces presented at [hsluv.org](http://www.hsluv.org)
|
Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an implementation of the colorspaces presented at [hsluv.org](http://www.hsluv.org)
|
||||||
<!-- __demos__ -->
|
<!-- __demos__ -->
|
||||||
## Demos
|
## Demos
|
||||||
|
### colormap/DemoSpectralZucconiColormap
|
||||||
|
[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormap.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### colormap/DemoSpectralZucconiColormapPhrase
|
||||||
|
[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormapPhrase.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### colormap/DemoSpectralZucconiColormapPlot
|
||||||
|
[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormapPlot.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### colormap/DemoTurboColormap
|
||||||
|
[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormap.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### colormap/DemoTurboColormapPhrase
|
||||||
|
[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormapPhrase.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### colormap/DemoTurboColormapPlot
|
||||||
|
[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormapPlot.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### colorRange/DemoColorRange01
|
||||||
|
[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange01.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### colorRange/DemoColorRange02
|
||||||
|
[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange02.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### colorRange/DemoColorRange03
|
||||||
|
[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange03.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### colorRange/DemoColorRange04
|
||||||
|
[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange04.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
### DemoColorPalette01
|
### DemoColorPalette01
|
||||||
[source code](src/jvmDemo/kotlin/DemoColorPalette01.kt)
|
[source code](src/jvmDemo/kotlin/DemoColorPalette01.kt)
|
||||||
|
|
||||||
@@ -69,26 +119,6 @@ Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an impleme
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
### DemoColorRange01
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoColorRange01.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoColorRange02
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoColorRange02.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoColorRange03
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoColorRange03.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoColorRange04
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoColorRange04.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoColorSequence01
|
### DemoColorSequence01
|
||||||
[source code](src/jvmDemo/kotlin/DemoColorSequence01.kt)
|
[source code](src/jvmDemo/kotlin/DemoColorSequence01.kt)
|
||||||
|
|
||||||
@@ -109,21 +139,6 @@ Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an impleme
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
### DemoHistogram01
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoHistogram01.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoHistogram02
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoHistogram02.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoHistogram03
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoHistogram03.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoHSLUV01
|
### DemoHSLUV01
|
||||||
[source code](src/jvmDemo/kotlin/DemoHSLUV01.kt)
|
[source code](src/jvmDemo/kotlin/DemoHSLUV01.kt)
|
||||||
|
|
||||||
@@ -149,37 +164,22 @@ Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an impleme
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
### DemoSpectralZucconiColormap
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoSpectralZucconiColormap.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoSpectralZucconiColormapPhrase
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoSpectralZucconiColormapPhrase.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoSpectralZucconiColormapPlot
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoSpectralZucconiColormapPlot.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoTurboColormap
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoTurboColormap.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoTurboColormapPhrase
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoTurboColormapPhrase.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoTurboColormapPlot
|
|
||||||
[source code](src/jvmDemo/kotlin/DemoTurboColormapPlot.kt)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### DemoXSLUV01
|
### DemoXSLUV01
|
||||||
[source code](src/jvmDemo/kotlin/DemoXSLUV01.kt)
|
[source code](src/jvmDemo/kotlin/DemoXSLUV01.kt)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
### histogram/DemoHistogram01
|
||||||
|
[source code](src/jvmDemo/kotlin/histogram/DemoHistogram01.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### histogram/DemoHistogram02
|
||||||
|
[source code](src/jvmDemo/kotlin/histogram/DemoHistogram02.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### histogram/DemoHistogram03
|
||||||
|
[source code](src/jvmDemo/kotlin/histogram/DemoHistogram03.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|||||||
@@ -11,7 +11,10 @@ import org.openrndr.extra.color.spaces.*
|
|||||||
* Demonstrates the creation of color palettes using various available methods
|
* Demonstrates the creation of color palettes using various available methods
|
||||||
*/
|
*/
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
configure { }
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 540
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
// HueShiftableColor:
|
// HueShiftableColor:
|
||||||
// HPLuv HSL HSV LCHab LCHuv XSL XSV XSLuv HSLuv OKHSL OKHSV OKLCH
|
// HPLuv HSL HSV LCHab LCHuv XSL XSV XSLuv HSLuv OKHSL OKHSV OKLCH
|
||||||
@@ -27,34 +30,33 @@ fun main() = application {
|
|||||||
|
|
||||||
palette0.forEachIndexed { i, c ->
|
palette0.forEachIndexed { i, c ->
|
||||||
drawer.fill = c
|
drawer.fill = c
|
||||||
drawer.circle(100.0 + i * 40.0, 80.0, 40.0)
|
drawer.circle(100.0 + i * 50.0, 80.0, 50.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
palette1.forEachIndexed { i, c ->
|
palette1.forEachIndexed { i, c ->
|
||||||
drawer.fill = c
|
drawer.fill = c
|
||||||
drawer.circle(100.0 + i * 40.0, 180.0, 40.0)
|
drawer.circle(100.0 + i * 50.0, 200.0, 50.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
palette2.forEachIndexed { i, c ->
|
palette2.forEachIndexed { i, c ->
|
||||||
drawer.fill = c
|
drawer.fill = c
|
||||||
drawer.circle(380.0 + i * 40.0, 180.0, 40.0)
|
drawer.circle(440.0 + i * 50.0, 200.0, 50.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
palette3.forEachIndexed { i, c ->
|
palette3.forEachIndexed { i, c ->
|
||||||
drawer.fill = c
|
drawer.fill = c
|
||||||
drawer.circle(100.0 + i * 40.0, 280.0, 40.0)
|
drawer.circle(100.0 + i * 50.0, 320.0, 50.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
palette4.forEachIndexed { i, c ->
|
palette4.forEachIndexed { i, c ->
|
||||||
drawer.fill = c
|
drawer.fill = c
|
||||||
drawer.circle(350.0 + i * 40.0, 280.0, 40.0)
|
drawer.circle(400.0 + i * 50.0, 320.0, 50.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
palette5.forEachIndexed { i, c ->
|
palette5.forEachIndexed { i, c ->
|
||||||
drawer.fill = c
|
drawer.fill = c
|
||||||
drawer.circle(100.0 + i * 40.0, 380.0, 40.0)
|
drawer.circle(100.0 + i * 50.0, 440.0, 50.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,10 @@ import org.openrndr.extra.color.tools.shadeLuminosity
|
|||||||
* an increased dynamic range.
|
* an increased dynamic range.
|
||||||
*/
|
*/
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 360
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
val count = 8
|
val count = 8
|
||||||
val palette = RGB.PINK.analogous<HSLuv>(360.0, count).mapIndexed { i, c ->
|
val palette = RGB.PINK.analogous<HSLuv>(360.0, count).mapIndexed { i, c ->
|
||||||
|
|||||||
@@ -7,12 +7,10 @@ import org.openrndr.extra.meshgenerators.sphereMesh
|
|||||||
import org.openrndr.math.Vector3
|
import org.openrndr.math.Vector3
|
||||||
import kotlin.math.cos
|
import kotlin.math.cos
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 800
|
width = 720
|
||||||
height = 800
|
height = 720
|
||||||
|
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
val mesh = sphereMesh(8, 8, radius = 0.1)
|
val mesh = sphereMesh(8, 8, radius = 0.1)
|
||||||
@@ -29,9 +27,7 @@ fun main() {
|
|||||||
|
|
||||||
extend {
|
extend {
|
||||||
drawer.clear(ColorRGBa.WHITE)
|
drawer.clear(ColorRGBa.WHITE)
|
||||||
|
|
||||||
drawer.stroke = null
|
drawer.stroke = null
|
||||||
|
|
||||||
drawer.fontMap = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 16.0)
|
drawer.fontMap = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 16.0)
|
||||||
|
|
||||||
instanceData.put {
|
instanceData.put {
|
||||||
@@ -82,5 +78,4 @@ fun main() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -7,11 +7,10 @@ import org.openrndr.extra.meshgenerators.sphereMesh
|
|||||||
import org.openrndr.math.Vector3
|
import org.openrndr.math.Vector3
|
||||||
import kotlin.math.cos
|
import kotlin.math.cos
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 800
|
width = 720
|
||||||
height = 800
|
height = 720
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
val mesh = sphereMesh(8, 8, radius = 0.1)
|
val mesh = sphereMesh(8, 8, radius = 0.1)
|
||||||
@@ -75,5 +74,4 @@ fun main() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
import org.openrndr.application
|
|
||||||
import org.openrndr.color.ColorRGBa
|
|
||||||
import org.openrndr.draw.loadFont
|
|
||||||
import org.openrndr.extra.color.spaces.*
|
|
||||||
import org.openrndr.extra.color.palettes.rangeTo
|
|
||||||
|
|
||||||
fun main() {
|
|
||||||
application {
|
|
||||||
configure {
|
|
||||||
height = 30 + 50 * 11 // row count
|
|
||||||
}
|
|
||||||
program {
|
|
||||||
extend {
|
|
||||||
drawer.clear(ColorRGBa.WHITE)
|
|
||||||
|
|
||||||
val colorA = ColorRGBa.BLUE
|
|
||||||
val colorB = ColorRGBa.PINK
|
|
||||||
|
|
||||||
val stepCount = 25
|
|
||||||
|
|
||||||
val allSteps = listOf(
|
|
||||||
"RGB" to (colorA..colorB blend stepCount),
|
|
||||||
"RGB linear" to (colorA.toLinear()..colorB.toLinear() blend stepCount),
|
|
||||||
"HSV" to (colorA..colorB.toHSVa() blend stepCount),
|
|
||||||
"Lab" to (colorA.toLABa()..colorB.toLABa() blend stepCount),
|
|
||||||
"LCh(ab)" to (colorA.toLCHABa()..colorB.toLCHABa() blend stepCount),
|
|
||||||
"OKLab" to (colorA.toOKLABa()..colorB.toOKLABa() blend stepCount),
|
|
||||||
"OKLCh" to (colorA.toOKLCHa()..colorB.toOKLCHa() blend stepCount),
|
|
||||||
"OKHSV" to (colorA.toOKHSVa()..colorB.toOKHSVa() blend stepCount),
|
|
||||||
"OKHSL" to (colorA.toOKHSLa()..colorB.toOKHSLa() blend stepCount),
|
|
||||||
"HSLUV" to (colorA.toHSLUVa()..colorB.toHSLUVa() blend stepCount),
|
|
||||||
"XSLUV" to (colorA.toXSLUVa()..colorB.toXSLUVa() blend stepCount),
|
|
||||||
)
|
|
||||||
|
|
||||||
drawer.stroke = null
|
|
||||||
|
|
||||||
drawer.fontMap = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 16.0)
|
|
||||||
drawer.translate(20.0, 20.0)
|
|
||||||
for ((label, steps) in allSteps) {
|
|
||||||
drawer.fill = ColorRGBa.GRAY.shade(0.25)
|
|
||||||
drawer.text(label, 0.0, 24.0)
|
|
||||||
|
|
||||||
for (i in steps.indices) {
|
|
||||||
drawer.fill = steps[i].toSRGB()
|
|
||||||
drawer.rectangle(100.0 + i * 20.0, 0.0, 20.0, 40.0)
|
|
||||||
}
|
|
||||||
drawer.translate(0.0, 50.0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
import org.openrndr.application
|
|
||||||
import org.openrndr.color.ColorRGBa
|
|
||||||
import org.openrndr.draw.DrawPrimitive
|
|
||||||
import org.openrndr.draw.isolated
|
|
||||||
import org.openrndr.draw.loadFont
|
|
||||||
import org.openrndr.extra.camera.Orbital
|
|
||||||
import org.openrndr.extra.color.palettes.rangeTo
|
|
||||||
import org.openrndr.extra.color.spaces.toHSLUVa
|
|
||||||
import org.openrndr.extra.color.spaces.toOKLABa
|
|
||||||
import org.openrndr.extra.color.spaces.toOKLCHa
|
|
||||||
import org.openrndr.extra.color.spaces.toXSLUVa
|
|
||||||
import org.openrndr.extra.meshgenerators.sphereMesh
|
|
||||||
import org.openrndr.math.Vector3
|
|
||||||
|
|
||||||
fun main() {
|
|
||||||
application {
|
|
||||||
configure {
|
|
||||||
width = 800
|
|
||||||
height = 800
|
|
||||||
}
|
|
||||||
program {
|
|
||||||
val mesh = sphereMesh(8, 8, radius = 0.1)
|
|
||||||
|
|
||||||
extend(Orbital())
|
|
||||||
|
|
||||||
extend {
|
|
||||||
drawer.clear(ColorRGBa.WHITE)
|
|
||||||
|
|
||||||
val colorA = ColorRGBa.BLUE.toHSVa().shiftHue(seconds * 40.0).toRGBa()
|
|
||||||
val colorB = ColorRGBa.PINK.toHSVa().shiftHue(-seconds * 34.0).toRGBa()
|
|
||||||
|
|
||||||
val stepCount = 25
|
|
||||||
|
|
||||||
val allSteps = listOf(
|
|
||||||
"RGB" to (colorA..colorB blend stepCount),
|
|
||||||
"RGB linear" to (colorA.toLinear()..colorB.toLinear() blend stepCount),
|
|
||||||
"HSV" to (colorA..colorB.toHSVa() blend stepCount),
|
|
||||||
"Lab" to (colorA.toLABa()..colorB.toLABa() blend stepCount),
|
|
||||||
"LCh(ab)" to (colorA.toLCHABa()..colorB.toLCHABa() blend stepCount),
|
|
||||||
"OKLab" to (colorA.toOKLABa()..colorB.toOKLABa() blend stepCount),
|
|
||||||
"OKLCh" to (colorA.toOKLCHa()..colorB.toOKLCHa() blend stepCount),
|
|
||||||
"HSLUV" to (colorA.toHSLUVa()..colorB.toHSLUVa() blend stepCount),
|
|
||||||
"XSLUV" to (colorA.toXSLUVa()..colorB.toXSLUVa() blend stepCount),
|
|
||||||
)
|
|
||||||
|
|
||||||
drawer.stroke = null
|
|
||||||
|
|
||||||
drawer.fontMap = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 16.0)
|
|
||||||
for ((_, steps) in allSteps) {
|
|
||||||
for (i in steps.indices) {
|
|
||||||
val srgb = steps[i].toSRGB().clip()
|
|
||||||
drawer.fill = srgb
|
|
||||||
drawer.isolated {
|
|
||||||
drawer.translate((srgb.r - 0.5) * 10.0, (srgb.g - 0.5) * 10.0, (srgb.b - 0.5) * 10.0)
|
|
||||||
drawer.vertexBuffer(mesh, DrawPrimitive.TRIANGLES)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val positions = steps.map {
|
|
||||||
val l = it.toSRGB().clip()
|
|
||||||
Vector3((l.r - 0.5) * 10.0, (l.g - 0.5) * 10.0, (l.b - 0.5) * 10.0)
|
|
||||||
}
|
|
||||||
drawer.stroke = ColorRGBa.BLACK.opacify(0.25)
|
|
||||||
drawer.strokeWeight = 10.0
|
|
||||||
drawer.lineStrip(positions)
|
|
||||||
}
|
|
||||||
drawer.lineSegments(
|
|
||||||
listOf(
|
|
||||||
Vector3(-5.0, -5.0, -5.0), Vector3(5.0, -5.0, -5.0),
|
|
||||||
Vector3(-5.0, -5.0, 5.0), Vector3(5.0, -5.0, 5.0),
|
|
||||||
Vector3(-5.0, 5.0, -5.0), Vector3(5.0, 5.0, -5.0),
|
|
||||||
Vector3(-5.0, 5.0, 5.0), Vector3(5.0, 5.0, 5.0),
|
|
||||||
|
|
||||||
Vector3(-5.0, -5.0, -5.0), Vector3(-5.0, 5.0, -5.0),
|
|
||||||
Vector3(5.0, -5.0, -5.0), Vector3(5.0, 5.0, -5.0),
|
|
||||||
Vector3(-5.0, -5.0, 5.0), Vector3(-5.0, 5.0, 5.0),
|
|
||||||
Vector3(5.0, -5.0, 5.0), Vector3(5.0, 5.0, 5.0),
|
|
||||||
|
|
||||||
Vector3(-5.0, -5.0, -5.0), Vector3(-5.0, -5.0, 5.0),
|
|
||||||
Vector3(5.0, -5.0, -5.0), Vector3(5.0, -5.0, 5.0),
|
|
||||||
Vector3(-5.0, 5.0, -5.0), Vector3(-5.0, 5.0, 5.0),
|
|
||||||
Vector3(5.0, 5.0, -5.0), Vector3(5.0, 5.0, 5.0),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -24,8 +24,7 @@ import org.openrndr.math.Vector3
|
|||||||
* - Applying a custom fragment shader with a palette-based shading style.
|
* - Applying a custom fragment shader with a palette-based shading style.
|
||||||
* - Rendering a grid of 3D spheres, each transformed and rotated to create a dynamic pattern.
|
* - Rendering a grid of 3D spheres, each transformed and rotated to create a dynamic pattern.
|
||||||
*/
|
*/
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 720
|
width = 720
|
||||||
height = 720
|
height = 720
|
||||||
@@ -67,5 +66,4 @@ fun main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,7 @@ import org.openrndr.extra.color.spaces.toOKHSVa
|
|||||||
import org.openrndr.extra.color.statistics.deltaE76
|
import org.openrndr.extra.color.statistics.deltaE76
|
||||||
import org.openrndr.math.Polar
|
import org.openrndr.math.Polar
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 720
|
width = 720
|
||||||
height = 720
|
height = 720
|
||||||
@@ -21,7 +20,7 @@ fun main() {
|
|||||||
|
|
||||||
drawer.stroke = null
|
drawer.stroke = null
|
||||||
|
|
||||||
val startColor = ColorRGBa.RED.toOKHSVa().shiftHue(seconds*36.0).toRGBa()
|
val startColor = ColorRGBa.RED.toOKHSVa().shiftHue(seconds * 36.0).toRGBa()
|
||||||
drawer.circles {
|
drawer.circles {
|
||||||
for (j in 99 downTo 0) {
|
for (j in 99 downTo 0) {
|
||||||
for (i in 0 until 360 step 10) {
|
for (i in 0 until 360 step 10) {
|
||||||
@@ -35,5 +34,4 @@ fun main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,7 @@ import org.openrndr.extra.color.fettepalette.generateColorRamp
|
|||||||
import org.openrndr.math.Vector2
|
import org.openrndr.math.Vector2
|
||||||
import kotlin.random.Random
|
import kotlin.random.Random
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 720
|
width = 720
|
||||||
height = 720
|
height = 720
|
||||||
@@ -82,5 +81,4 @@ fun main() {
|
|||||||
rampSquare(ramp, random, Vector2(180.0, 180.0), 360.0)
|
rampSquare(ramp, random, Vector2(180.0, 180.0), 360.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -8,8 +8,7 @@ import org.openrndr.extra.gui.addTo
|
|||||||
import org.openrndr.math.Vector2
|
import org.openrndr.math.Vector2
|
||||||
import kotlin.random.Random
|
import kotlin.random.Random
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 720
|
width = 720
|
||||||
height = 720
|
height = 720
|
||||||
@@ -73,5 +72,4 @@ fun main() {
|
|||||||
rampSquare(ramp, random, Vector2(20.0, 180.0), 360.0)
|
rampSquare(ramp, random, Vector2(20.0, 180.0), 360.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -10,8 +10,11 @@ import org.openrndr.extra.color.spaces.ColorHSLUVa
|
|||||||
import org.openrndr.math.Vector2
|
import org.openrndr.math.Vector2
|
||||||
import org.openrndr.shape.Rectangle
|
import org.openrndr.shape.Rectangle
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 540
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
val font = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 26.0)
|
val font = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 26.0)
|
||||||
extend {
|
extend {
|
||||||
@@ -33,14 +36,15 @@ fun main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
drawer.fontMap = font
|
drawer.fontMap = font
|
||||||
drawer.fill = if(l > 0.8) ColorRGBa.BLACK else ColorRGBa.WHITE
|
drawer.fill = if (l > 0.8) ColorRGBa.BLACK else ColorRGBa.WHITE
|
||||||
drawer.text("HSLa", width * 0.48, height * 0.73)
|
drawer.text("HSLa", width * 0.48, height * 0.73)
|
||||||
drawer.text("HSLUVa", width * 0.8, height * 0.52)
|
drawer.text("HSLUVa", width * 0.8, height * 0.52)
|
||||||
drawer.text("hue: 0 to 360, " +
|
drawer.text(
|
||||||
|
"hue: 0 to 360, " +
|
||||||
"saturation: ${String.format("%.02f", s)}, " +
|
"saturation: ${String.format("%.02f", s)}, " +
|
||||||
"lightness: ${String.format("%.02f", l)}",
|
"lightness: ${String.format("%.02f", l)}",
|
||||||
30.0, 460.0)
|
30.0, height - 30.0
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,8 +7,7 @@ import org.openrndr.math.Polar
|
|||||||
import org.openrndr.math.Vector2
|
import org.openrndr.math.Vector2
|
||||||
import kotlin.math.sqrt
|
import kotlin.math.sqrt
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 720
|
width = 720
|
||||||
height = 720
|
height = 720
|
||||||
@@ -36,12 +35,12 @@ fun main() {
|
|||||||
val h = i.theta
|
val h = i.theta
|
||||||
val s = i.radius / (count * g)
|
val s = i.radius / (count * g)
|
||||||
for (l in 9 downTo 0) {
|
for (l in 9 downTo 0) {
|
||||||
val position = i.cartesian / (count * g) * (width / 2.0 - bobRadius) + Vector2(width / 2.0, height / 2.0)
|
val position =
|
||||||
|
i.cartesian / (count * g) * (width / 2.0 - bobRadius) + Vector2(width / 2.0, height / 2.0)
|
||||||
drawer.fill = hc.shiftHue(h).saturate(s).shade((9 - l) / 4.5).toRGBa().toSRGB()
|
drawer.fill = hc.shiftHue(h).saturate(s).shade((9 - l) / 4.5).toRGBa().toSRGB()
|
||||||
drawer.circle(position, sqrt(s) * 20.0 * l / 9.0)
|
drawer.circle(position, sqrt(s) * 20.0 * l / 9.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -5,16 +5,15 @@ import org.openrndr.extra.color.spaces.OKHSV
|
|||||||
import org.openrndr.extra.color.tools.mixHue
|
import org.openrndr.extra.color.tools.mixHue
|
||||||
import org.openrndr.extra.color.tools.withHue
|
import org.openrndr.extra.color.tools.withHue
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 800
|
width = 720
|
||||||
height = 800
|
height = 720
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
extend {
|
extend {
|
||||||
val seedColor = ColorRGBa.PINK
|
val seedColor = ColorRGBa.PINK
|
||||||
val targetHue = seconds*100.0
|
val targetHue = seconds * 100.0
|
||||||
|
|
||||||
val rows = 10
|
val rows = 10
|
||||||
val columns = 12
|
val columns = 12
|
||||||
@@ -28,7 +27,7 @@ fun main() {
|
|||||||
for (i in 0 until columns) {
|
for (i in 0 until columns) {
|
||||||
drawer.fill = seedColor
|
drawer.fill = seedColor
|
||||||
.withHue<OKHSV>(i * 360.0 / columns)
|
.withHue<OKHSV>(i * 360.0 / columns)
|
||||||
.mixHue<OKHSV>(targetHue, j / (rows.toDouble()-1.0))
|
.mixHue<OKHSV>(targetHue, j / (rows.toDouble() - 1.0))
|
||||||
drawer.rectangle(0.0, 0.0, cellWidth, cellHeight)
|
drawer.rectangle(0.0, 0.0, cellWidth, cellHeight)
|
||||||
drawer.translate(cellWidth, 0.0)
|
drawer.translate(cellWidth, 0.0)
|
||||||
}
|
}
|
||||||
@@ -37,5 +36,4 @@ fun main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -3,41 +3,33 @@ import org.openrndr.color.ColorRGBa
|
|||||||
import org.openrndr.draw.isolated
|
import org.openrndr.draw.isolated
|
||||||
import org.openrndr.extra.color.mixing.mixSpectral
|
import org.openrndr.extra.color.mixing.mixSpectral
|
||||||
import org.openrndr.extra.color.spaces.OKHSV
|
import org.openrndr.extra.color.spaces.OKHSV
|
||||||
|
import org.openrndr.extra.color.spaces.OKLab
|
||||||
|
import org.openrndr.extra.color.tools.saturate
|
||||||
|
import org.openrndr.extra.color.tools.shadeLuminosity
|
||||||
import org.openrndr.extra.color.tools.shiftHue
|
import org.openrndr.extra.color.tools.shiftHue
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 800
|
width = 720
|
||||||
height = 800
|
height = 720
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
|
|
||||||
extend {
|
extend {
|
||||||
|
val a = ColorRGBa.BLUE.shiftHue<OKHSV>(0.0).saturate<OKHSV>(0.3).shadeLuminosity<OKLab>(0.3)
|
||||||
for (j in 0 until 60) {
|
val b = ColorRGBa.BLUE.shiftHue<OKHSV>(60.0).saturate<OKHSV>(0.8)
|
||||||
val p = 3.0
|
|
||||||
val a = ColorRGBa.BLUE.shiftHue<OKHSV>(j * p)
|
|
||||||
val b = ColorRGBa.BLUE.shiftHue<OKHSV>(j * p + 180.0)
|
|
||||||
|
|
||||||
drawer.isolated {
|
drawer.isolated {
|
||||||
for (i in 0 until 60) {
|
for (i in 0 until 60) {
|
||||||
|
|
||||||
val c = mixSpectral(a, b, i / 59.0, 0.0, 0.0).toSRGB()
|
val c = mixSpectral(a, b, i / 59.0, 0.0, 0.0).toSRGB()
|
||||||
drawer.fill = c
|
drawer.fill = c
|
||||||
drawer.stroke = null
|
drawer.stroke = null
|
||||||
drawer.rectangle(0.0, 0.0, width/60.0, 0.5 * height/60.0)
|
drawer.rectangle(0.0, 0.0, width / 60.0, 1.0 * height)
|
||||||
|
|
||||||
drawer.fill = a.mix(b, i / 59.0)
|
drawer.translate(width / 60.0, 0.0)
|
||||||
drawer.rectangle(0.0, 0.5 * height, width/60.0, 0.5 * height/60.0)
|
|
||||||
|
|
||||||
drawer.translate(width/60.0, 0.0)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drawer.translate(0.0, 0.5 * height/60.0)
|
drawer.translate(0.0, 0.5 * height / 60.0)
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,18 @@
|
|||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.color.ColorRGBa
|
import org.openrndr.color.ColorRGBa
|
||||||
|
import org.openrndr.color.rgb
|
||||||
import org.openrndr.extra.color.spaces.ColorOKHSLa
|
import org.openrndr.extra.color.spaces.ColorOKHSLa
|
||||||
import org.openrndr.extra.color.spaces.ColorOKHSVa
|
import org.openrndr.extra.color.spaces.ColorOKHSVa
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 160
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
extend {
|
extend {
|
||||||
|
drawer.clear(rgb(0.2))
|
||||||
|
|
||||||
val c = ColorRGBa.GREEN
|
val c = ColorRGBa.GREEN
|
||||||
val okhsv = ColorOKHSVa.fromColorRGBa(c)
|
val okhsv = ColorOKHSVa.fromColorRGBa(c)
|
||||||
val hsv = c.toHSVa()
|
val hsv = c.toHSVa()
|
||||||
|
|||||||
@@ -3,15 +3,22 @@
|
|||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.color.ColorRGBa
|
import org.openrndr.color.ColorRGBa
|
||||||
import org.openrndr.extra.color.spaces.ColorXSLUVa
|
import org.openrndr.extra.color.spaces.ColorXSLUVa
|
||||||
import org.openrndr.extra.color.spaces.toHSLUVa
|
|
||||||
import org.openrndr.math.Polar
|
import org.openrndr.math.Polar
|
||||||
import org.openrndr.shape.contour
|
import org.openrndr.shape.contour
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 720
|
||||||
|
}
|
||||||
|
|
||||||
class Arc(val start: Double, val radius: Double, val length: Double, val height: Double) {
|
class Arc(val start: Double, val radius: Double, val length: Double, val height: Double) {
|
||||||
fun split(offset: Double = 0.0): List<Arc> {
|
fun split(offset: Double = 0.0): List<Arc> {
|
||||||
val hl = length / 2.0
|
val hl = length / 2.0
|
||||||
return listOf(Arc(start, radius + offset, hl, height), Arc(start + hl, radius + offset, hl, height))
|
return listOf(
|
||||||
|
Arc(start, radius + offset, hl, height),
|
||||||
|
Arc(start + hl, radius + offset, hl, height)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val contour
|
val contour
|
||||||
@@ -31,19 +38,12 @@ fun main() {
|
|||||||
this + flatMap { it.split(it.height) }.split(depth - 1)
|
this + flatMap { it.split(it.height) }.split(depth - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
|
||||||
configure {
|
|
||||||
width = 720
|
|
||||||
height = 720
|
|
||||||
}
|
|
||||||
|
|
||||||
program {
|
program {
|
||||||
val arcs = (0..4).map { Arc(it * 90.0 - 45.0, 50.0, 90.0, 50.0) }.split(5)
|
val arcs = (0..4).map { Arc(it * 90.0 - 45.0, 50.0, 90.0, 50.0) }.split(5)
|
||||||
|
|
||||||
extend {
|
extend {
|
||||||
drawer.clear(ColorRGBa.GRAY)
|
drawer.clear(ColorRGBa.GRAY)
|
||||||
val color = ColorRGBa.RED
|
val color = ColorRGBa.RED
|
||||||
val hc = color.toHSLUVa()
|
|
||||||
drawer.stroke = ColorRGBa.BLACK
|
drawer.stroke = ColorRGBa.BLACK
|
||||||
drawer.strokeWeight = 1.0
|
drawer.strokeWeight = 1.0
|
||||||
drawer.translate(drawer.bounds.center)
|
drawer.translate(drawer.bounds.center)
|
||||||
@@ -56,5 +56,4 @@ fun main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package colorRange
|
||||||
|
|
||||||
// Comparison of color lists generated by interpolating from
|
// Comparison of color lists generated by interpolating from
|
||||||
// PINK to BLUE in different color models
|
// PINK to BLUE in different color models
|
||||||
|
|
||||||
@@ -10,6 +12,10 @@ import org.openrndr.math.map
|
|||||||
import org.openrndr.shape.Rectangle
|
import org.openrndr.shape.Rectangle
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 540
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
val numColors = 10
|
val numColors = 10
|
||||||
val colorLists = listOf(
|
val colorLists = listOf(
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package colorRange
|
||||||
|
|
||||||
// Create a colorSequence with multiple color models
|
// Create a colorSequence with multiple color models
|
||||||
|
|
||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
@@ -6,6 +8,10 @@ import org.openrndr.extra.color.palettes.colorSequence
|
|||||||
import org.openrndr.extra.color.spaces.toHSLUVa
|
import org.openrndr.extra.color.spaces.toHSLUVa
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 360
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
extend {
|
extend {
|
||||||
val cs = colorSequence(0.0 to ColorRGBa.PINK,
|
val cs = colorSequence(0.0 to ColorRGBa.PINK,
|
||||||
53
orx-color/src/jvmDemo/kotlin/colorRange/DemoColorRange03.kt
Normal file
53
orx-color/src/jvmDemo/kotlin/colorRange/DemoColorRange03.kt
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package colorRange
|
||||||
|
|
||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.color.ColorRGBa
|
||||||
|
import org.openrndr.draw.loadFont
|
||||||
|
import org.openrndr.extra.color.palettes.rangeTo
|
||||||
|
import org.openrndr.extra.color.spaces.*
|
||||||
|
|
||||||
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 30 + 50 * 11 // row count
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
extend {
|
||||||
|
drawer.clear(ColorRGBa.WHITE)
|
||||||
|
|
||||||
|
val colorA = ColorRGBa.BLUE
|
||||||
|
val colorB = ColorRGBa.PINK
|
||||||
|
|
||||||
|
val stepCount = 25
|
||||||
|
|
||||||
|
val allSteps = listOf(
|
||||||
|
"RGB" to (colorA..colorB blend stepCount),
|
||||||
|
"RGB linear" to (colorA.toLinear()..colorB.toLinear() blend stepCount),
|
||||||
|
"HSV" to (colorA..colorB.toHSVa() blend stepCount),
|
||||||
|
"Lab" to (colorA.toLABa()..colorB.toLABa() blend stepCount),
|
||||||
|
"LCh(ab)" to (colorA.toLCHABa()..colorB.toLCHABa() blend stepCount),
|
||||||
|
"OKLab" to (colorA.toOKLABa()..colorB.toOKLABa() blend stepCount),
|
||||||
|
"OKLCh" to (colorA.toOKLCHa()..colorB.toOKLCHa() blend stepCount),
|
||||||
|
"OKHSV" to (colorA.toOKHSVa()..colorB.toOKHSVa() blend stepCount),
|
||||||
|
"OKHSL" to (colorA.toOKHSLa()..colorB.toOKHSLa() blend stepCount),
|
||||||
|
"HSLUV" to (colorA.toHSLUVa()..colorB.toHSLUVa() blend stepCount),
|
||||||
|
"XSLUV" to (colorA.toXSLUVa()..colorB.toXSLUVa() blend stepCount),
|
||||||
|
)
|
||||||
|
|
||||||
|
drawer.stroke = null
|
||||||
|
|
||||||
|
drawer.fontMap = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 16.0)
|
||||||
|
drawer.translate(20.0, 20.0)
|
||||||
|
for ((label, steps) in allSteps) {
|
||||||
|
drawer.fill = ColorRGBa.GRAY.shade(0.25)
|
||||||
|
drawer.text(label, 0.0, 24.0)
|
||||||
|
|
||||||
|
for (i in steps.indices) {
|
||||||
|
drawer.fill = steps[i].toSRGB()
|
||||||
|
drawer.rectangle(100.0 + i * 20.0, 0.0, 20.0, 40.0)
|
||||||
|
}
|
||||||
|
drawer.translate(0.0, 50.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
87
orx-color/src/jvmDemo/kotlin/colorRange/DemoColorRange04.kt
Normal file
87
orx-color/src/jvmDemo/kotlin/colorRange/DemoColorRange04.kt
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
package colorRange
|
||||||
|
|
||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.color.ColorRGBa
|
||||||
|
import org.openrndr.draw.DrawPrimitive
|
||||||
|
import org.openrndr.draw.isolated
|
||||||
|
import org.openrndr.draw.loadFont
|
||||||
|
import org.openrndr.extra.camera.Orbital
|
||||||
|
import org.openrndr.extra.color.palettes.rangeTo
|
||||||
|
import org.openrndr.extra.color.spaces.toHSLUVa
|
||||||
|
import org.openrndr.extra.color.spaces.toOKLABa
|
||||||
|
import org.openrndr.extra.color.spaces.toOKLCHa
|
||||||
|
import org.openrndr.extra.color.spaces.toXSLUVa
|
||||||
|
import org.openrndr.extra.meshgenerators.sphereMesh
|
||||||
|
import org.openrndr.math.Vector3
|
||||||
|
|
||||||
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 720
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
val mesh = sphereMesh(8, 8, radius = 0.1)
|
||||||
|
|
||||||
|
extend(Orbital())
|
||||||
|
|
||||||
|
extend {
|
||||||
|
drawer.clear(ColorRGBa.WHITE)
|
||||||
|
|
||||||
|
val colorA = ColorRGBa.BLUE.toHSVa().shiftHue(seconds * 40.0).toRGBa()
|
||||||
|
val colorB = ColorRGBa.PINK.toHSVa().shiftHue(-seconds * 34.0).toRGBa()
|
||||||
|
|
||||||
|
val stepCount = 25
|
||||||
|
|
||||||
|
val allSteps = listOf(
|
||||||
|
"RGB" to (colorA..colorB blend stepCount),
|
||||||
|
"RGB linear" to (colorA.toLinear()..colorB.toLinear() blend stepCount),
|
||||||
|
"HSV" to (colorA..colorB.toHSVa() blend stepCount),
|
||||||
|
"Lab" to (colorA.toLABa()..colorB.toLABa() blend stepCount),
|
||||||
|
"LCh(ab)" to (colorA.toLCHABa()..colorB.toLCHABa() blend stepCount),
|
||||||
|
"OKLab" to (colorA.toOKLABa()..colorB.toOKLABa() blend stepCount),
|
||||||
|
"OKLCh" to (colorA.toOKLCHa()..colorB.toOKLCHa() blend stepCount),
|
||||||
|
"HSLUV" to (colorA.toHSLUVa()..colorB.toHSLUVa() blend stepCount),
|
||||||
|
"XSLUV" to (colorA.toXSLUVa()..colorB.toXSLUVa() blend stepCount),
|
||||||
|
)
|
||||||
|
|
||||||
|
drawer.stroke = null
|
||||||
|
|
||||||
|
drawer.fontMap = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 16.0)
|
||||||
|
for ((_, steps) in allSteps) {
|
||||||
|
for (i in steps.indices) {
|
||||||
|
val srgb = steps[i].toSRGB().clip()
|
||||||
|
drawer.fill = srgb
|
||||||
|
drawer.isolated {
|
||||||
|
drawer.translate((srgb.r - 0.5) * 10.0, (srgb.g - 0.5) * 10.0, (srgb.b - 0.5) * 10.0)
|
||||||
|
drawer.vertexBuffer(mesh, DrawPrimitive.TRIANGLES)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val positions = steps.map {
|
||||||
|
val l = it.toSRGB().clip()
|
||||||
|
Vector3((l.r - 0.5) * 10.0, (l.g - 0.5) * 10.0, (l.b - 0.5) * 10.0)
|
||||||
|
}
|
||||||
|
drawer.stroke = ColorRGBa.BLACK.opacify(0.25)
|
||||||
|
drawer.strokeWeight = 10.0
|
||||||
|
drawer.lineStrip(positions)
|
||||||
|
}
|
||||||
|
drawer.lineSegments(
|
||||||
|
listOf(
|
||||||
|
Vector3(-5.0, -5.0, -5.0), Vector3(5.0, -5.0, -5.0),
|
||||||
|
Vector3(-5.0, -5.0, 5.0), Vector3(5.0, -5.0, 5.0),
|
||||||
|
Vector3(-5.0, 5.0, -5.0), Vector3(5.0, 5.0, -5.0),
|
||||||
|
Vector3(-5.0, 5.0, 5.0), Vector3(5.0, 5.0, 5.0),
|
||||||
|
|
||||||
|
Vector3(-5.0, -5.0, -5.0), Vector3(-5.0, 5.0, -5.0),
|
||||||
|
Vector3(5.0, -5.0, -5.0), Vector3(5.0, 5.0, -5.0),
|
||||||
|
Vector3(-5.0, -5.0, 5.0), Vector3(-5.0, 5.0, 5.0),
|
||||||
|
Vector3(5.0, -5.0, 5.0), Vector3(5.0, 5.0, 5.0),
|
||||||
|
|
||||||
|
Vector3(-5.0, -5.0, -5.0), Vector3(-5.0, -5.0, 5.0),
|
||||||
|
Vector3(5.0, -5.0, -5.0), Vector3(5.0, -5.0, 5.0),
|
||||||
|
Vector3(-5.0, 5.0, -5.0), Vector3(-5.0, 5.0, 5.0),
|
||||||
|
Vector3(5.0, 5.0, -5.0), Vector3(5.0, 5.0, 5.0),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
|
package colormap
|
||||||
|
|
||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.extra.color.colormaps.spectralZucconi6
|
import org.openrndr.extra.color.colormaps.spectralZucconi6
|
||||||
import org.openrndr.extra.noise.fastFloor
|
import org.openrndr.extra.noise.fastFloor
|
||||||
import kotlin.math.sin
|
import kotlin.math.sin
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 360
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
extend {
|
extend {
|
||||||
drawer.stroke = null
|
drawer.stroke = null
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
|
package colormap
|
||||||
|
|
||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.draw.shadeStyle
|
import org.openrndr.draw.shadeStyle
|
||||||
import org.openrndr.extra.color.colormaps.ColormapPhraseBook
|
import org.openrndr.extra.color.colormaps.ColormapPhraseBook
|
||||||
import org.openrndr.extra.shaderphrases.preprocess
|
import org.openrndr.extra.shaderphrases.preprocess
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 360
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
ColormapPhraseBook.register()
|
ColormapPhraseBook.register()
|
||||||
val style = shadeStyle {
|
val style = shadeStyle {
|
||||||
@@ -11,10 +17,8 @@ fun main() = application {
|
|||||||
fragmentTransform = "x_fill.rgb = spectral_zucconi6(c_boundsPosition.x);"
|
fragmentTransform = "x_fill.rgb = spectral_zucconi6(c_boundsPosition.x);"
|
||||||
}
|
}
|
||||||
extend {
|
extend {
|
||||||
drawer.run {
|
drawer.shadeStyle = style
|
||||||
shadeStyle = style
|
drawer.rectangle(drawer.bounds)
|
||||||
rectangle(bounds)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package colormap
|
||||||
|
|
||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.color.ColorRGBa
|
import org.openrndr.color.ColorRGBa
|
||||||
import org.openrndr.draw.shadeStyle
|
import org.openrndr.draw.shadeStyle
|
||||||
@@ -7,22 +9,28 @@ import org.openrndr.extra.shaderphrases.preprocess
|
|||||||
import org.openrndr.math.Vector2
|
import org.openrndr.math.Vector2
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 360
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
ColormapPhraseBook.register()
|
ColormapPhraseBook.register()
|
||||||
val backgroundStyle = shadeStyle {
|
val backgroundStyle = shadeStyle {
|
||||||
fragmentPreamble = "#pragma import colormap.spectral_zucconi6".preprocess()
|
fragmentPreamble = "#pragma import colormap.spectral_zucconi6".preprocess()
|
||||||
fragmentTransform = "x_fill.rgb = spectral_zucconi6(c_boundsPosition.x);"
|
fragmentTransform = "x_fill.rgb = spectral_zucconi6(c_boundsPosition.x);"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getColormapPoints(
|
fun getColormapPoints(
|
||||||
block: ColorRGBa.() -> Double
|
block: ColorRGBa.() -> Double
|
||||||
) = List(width) { x ->
|
) = List(width) { x ->
|
||||||
Vector2(
|
Vector2(
|
||||||
x = x.toDouble(),
|
x.toDouble(),
|
||||||
y = height.toDouble()
|
height.toDouble()
|
||||||
- block(spectralZucconi6(x / width.toDouble()))
|
- block(spectralZucconi6(x / width.toDouble()))
|
||||||
* height.toDouble()
|
* height.toDouble()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val redPoints = getColormapPoints { r }
|
val redPoints = getColormapPoints { r }
|
||||||
val greenPoints = getColormapPoints { g }
|
val greenPoints = getColormapPoints { g }
|
||||||
val bluePoints = getColormapPoints { b }
|
val bluePoints = getColormapPoints { b }
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
|
package colormap
|
||||||
|
|
||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.extra.color.colormaps.turboColormap
|
import org.openrndr.extra.color.colormaps.turboColormap
|
||||||
import org.openrndr.extra.noise.fastFloor
|
import org.openrndr.extra.noise.fastFloor
|
||||||
import kotlin.math.sin
|
import kotlin.math.sin
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 360
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
extend {
|
extend {
|
||||||
drawer.stroke = null
|
drawer.stroke = null
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
|
package colormap
|
||||||
|
|
||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.draw.shadeStyle
|
import org.openrndr.draw.shadeStyle
|
||||||
import org.openrndr.extra.color.colormaps.ColormapPhraseBook
|
import org.openrndr.extra.color.colormaps.ColormapPhraseBook
|
||||||
import org.openrndr.extra.shaderphrases.preprocess
|
import org.openrndr.extra.shaderphrases.preprocess
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 360
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
ColormapPhraseBook.register()
|
ColormapPhraseBook.register()
|
||||||
val style = shadeStyle {
|
val style = shadeStyle {
|
||||||
@@ -11,10 +17,8 @@ fun main() = application {
|
|||||||
fragmentTransform = "x_fill.rgb = turbo_colormap(c_boundsPosition.x);"
|
fragmentTransform = "x_fill.rgb = turbo_colormap(c_boundsPosition.x);"
|
||||||
}
|
}
|
||||||
extend {
|
extend {
|
||||||
drawer.run {
|
drawer.shadeStyle = style
|
||||||
shadeStyle = style
|
drawer.rectangle(drawer.bounds)
|
||||||
rectangle(bounds)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package colormap
|
||||||
|
|
||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.color.ColorRGBa
|
import org.openrndr.color.ColorRGBa
|
||||||
import org.openrndr.draw.shadeStyle
|
import org.openrndr.draw.shadeStyle
|
||||||
@@ -7,6 +9,10 @@ import org.openrndr.extra.shaderphrases.preprocess
|
|||||||
import org.openrndr.math.Vector2
|
import org.openrndr.math.Vector2
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 360
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
ColormapPhraseBook.register()
|
ColormapPhraseBook.register()
|
||||||
val backgroundStyle = shadeStyle {
|
val backgroundStyle = shadeStyle {
|
||||||
@@ -1,10 +1,14 @@
|
|||||||
// Show color histogram of an image
|
package histogram// Show color histogram of an image
|
||||||
|
|
||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.draw.loadImage
|
import org.openrndr.draw.loadImage
|
||||||
import org.openrndr.extra.color.statistics.calculateHistogramRGB
|
import org.openrndr.extra.color.statistics.calculateHistogramRGB
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 540
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
val useColors = 32
|
val useColors = 32
|
||||||
val image = loadImage("demo-data/images/image-001.png")
|
val image = loadImage("demo-data/images/image-001.png")
|
||||||
@@ -29,7 +33,7 @@ fun main() = application {
|
|||||||
"% of the image colors.")
|
"% of the image colors.")
|
||||||
|
|
||||||
extend {
|
extend {
|
||||||
drawer.image(image)
|
drawer.image(image, 0.0, 0.0, width * 1.0, height * 1.0)
|
||||||
drawer.stroke = null
|
drawer.stroke = null
|
||||||
var x = 0.0
|
var x = 0.0
|
||||||
topColorsSortedByLuminosity.forEachIndexed { i, (color, freq) ->
|
topColorsSortedByLuminosity.forEachIndexed { i, (color, freq) ->
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Show color histogram using non-uniform weighting
|
package histogram// Show color histogram using non-uniform weighting
|
||||||
|
|
||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.draw.loadImage
|
import org.openrndr.draw.loadImage
|
||||||
@@ -6,6 +6,10 @@ import org.openrndr.extra.color.statistics.calculateHistogramRGB
|
|||||||
import kotlin.math.pow
|
import kotlin.math.pow
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 540
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
val image = loadImage("demo-data/images/image-001.png")
|
val image = loadImage("demo-data/images/image-001.png")
|
||||||
// -- here we use non-uniform weighting, such that bright colors are prioritized
|
// -- here we use non-uniform weighting, such that bright colors are prioritized
|
||||||
@@ -16,7 +20,7 @@ fun main() = application {
|
|||||||
// .subList(0, 32).sortedBy { it.first.toHSLa().h } // sort by hue
|
// .subList(0, 32).sortedBy { it.first.toHSLa().h } // sort by hue
|
||||||
|
|
||||||
extend {
|
extend {
|
||||||
drawer.image(image)
|
drawer.image(image, 0.0, 0.0, width * 1.0, height * 1.0)
|
||||||
for (i in 0 until 32) {
|
for (i in 0 until 32) {
|
||||||
drawer.fill = colors[i].first
|
drawer.fill = colors[i].first
|
||||||
drawer.stroke = null
|
drawer.stroke = null
|
||||||
@@ -1,15 +1,18 @@
|
|||||||
// Create a simple rectangle composition based on colors sampled from image
|
package histogram// Create a simple rectangle composition based on colors sampled from image
|
||||||
|
|
||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.draw.loadImage
|
import org.openrndr.draw.loadImage
|
||||||
import org.openrndr.extra.color.statistics.calculateHistogramRGB
|
import org.openrndr.extra.color.statistics.calculateHistogramRGB
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 540
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
val image = loadImage("demo-data/images/image-001.png")
|
val image = loadImage("demo-data/images/image-001.png")
|
||||||
val histogram = calculateHistogramRGB(image)
|
val histogram = calculateHistogramRGB(image)
|
||||||
extend {
|
extend {
|
||||||
drawer.image(image)
|
|
||||||
for (j in 0 until height step 32) {
|
for (j in 0 until height step 32) {
|
||||||
for (i in 0 until width step 32) {
|
for (i in 0 until width step 32) {
|
||||||
drawer.stroke = null
|
drawer.stroke = null
|
||||||
@@ -18,8 +18,8 @@ import org.openrndr.shape.Rectangle
|
|||||||
*/
|
*/
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
configure {
|
configure {
|
||||||
width = 1024
|
width = 720
|
||||||
height = 1024
|
height = 720
|
||||||
}
|
}
|
||||||
|
|
||||||
program {
|
program {
|
||||||
|
|||||||
@@ -1,25 +1,23 @@
|
|||||||
import org.openrndr.MouseTracker
|
|
||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.color.ColorRGBa
|
import org.openrndr.color.ColorRGBa
|
||||||
import org.openrndr.draw.*
|
import org.openrndr.draw.ColorType
|
||||||
|
import org.openrndr.draw.constant
|
||||||
|
import org.openrndr.draw.createEquivalent
|
||||||
|
import org.openrndr.draw.tint
|
||||||
import org.openrndr.drawImage
|
import org.openrndr.drawImage
|
||||||
import org.openrndr.extra.jumpfill.DirectionalField
|
import org.openrndr.extra.jumpfill.DirectionalField
|
||||||
import org.openrndr.extra.noise.scatter
|
import org.openrndr.extra.noise.scatter
|
||||||
import org.openrndr.extra.noise.simplex
|
|
||||||
import org.openrndr.math.IntVector2
|
import org.openrndr.math.IntVector2
|
||||||
import org.openrndr.math.Vector2
|
|
||||||
import org.openrndr.math.Vector3
|
import org.openrndr.math.Vector3
|
||||||
import org.openrndr.math.clamp
|
import org.openrndr.math.clamp
|
||||||
import org.openrndr.shape.Rectangle
|
|
||||||
import kotlin.math.abs
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create directional distance field and demonstrate signed distance
|
* Create directional distance field and demonstrate signed distance
|
||||||
*/
|
*/
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
configure {
|
configure {
|
||||||
width = 1024
|
width = 720
|
||||||
height = 1024
|
height = 720
|
||||||
}
|
}
|
||||||
|
|
||||||
program {
|
program {
|
||||||
@@ -37,7 +35,10 @@ fun main() = application {
|
|||||||
|
|
||||||
ddf.shadow.download()
|
ddf.shadow.download()
|
||||||
extend {
|
extend {
|
||||||
val p = (mouse.position * ddf.contentScale).toInt().clamp(IntVector2.ZERO, IntVector2(width-1, height-1))
|
val p = (mouse.position * ddf.contentScale).toInt().clamp(
|
||||||
|
IntVector2.ZERO,
|
||||||
|
IntVector2(width - 1, height - 1)
|
||||||
|
)
|
||||||
val c = ddf.shadow[p.x, p.y]
|
val c = ddf.shadow[p.x, p.y]
|
||||||
val sdf3 = Vector3(c.r, c.g, c.b)
|
val sdf3 = Vector3(c.r, c.g, c.b)
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ import org.openrndr.shape.Rectangle
|
|||||||
*/
|
*/
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
configure {
|
configure {
|
||||||
width = 1024
|
width = 720
|
||||||
height = 1024
|
height = 720
|
||||||
}
|
}
|
||||||
|
|
||||||
program {
|
program {
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ import org.openrndr.extra.fx.patterns.Checkers
|
|||||||
import org.openrndr.extra.jumpfill.fx.InnerGlow
|
import org.openrndr.extra.jumpfill.fx.InnerGlow
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 720
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
val c = compose {
|
val c = compose {
|
||||||
layer {
|
layer {
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ import org.openrndr.extra.fx.patterns.Checkers
|
|||||||
import org.openrndr.extra.jumpfill.fx.InnerGlow
|
import org.openrndr.extra.jumpfill.fx.InnerGlow
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 720
|
||||||
|
}
|
||||||
program {
|
program {
|
||||||
val c = compose {
|
val c = compose {
|
||||||
layer {
|
layer {
|
||||||
|
|||||||
@@ -6,11 +6,10 @@ import org.openrndr.draw.colorBuffer
|
|||||||
import org.openrndr.extra.jumpfill.ShapeSDF
|
import org.openrndr.extra.jumpfill.ShapeSDF
|
||||||
import org.openrndr.extra.svg.loadSVG
|
import org.openrndr.extra.svg.loadSVG
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 1280
|
width = 720
|
||||||
height = 720
|
height = 405
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
val sdf = ShapeSDF()
|
val sdf = ShapeSDF()
|
||||||
@@ -29,5 +28,4 @@ fun main() {
|
|||||||
drawer.shapes(shapes)
|
drawer.shapes(shapes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -13,11 +13,10 @@ import org.openrndr.math.transforms.transform
|
|||||||
|
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 1280
|
width = 720
|
||||||
height = 720
|
height = 405
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
val sdf0 = ShapeSDF()
|
val sdf0 = ShapeSDF()
|
||||||
@@ -41,9 +40,9 @@ fun main() {
|
|||||||
|
|
||||||
sdf1.setShapes(shapes.map {
|
sdf1.setShapes(shapes.map {
|
||||||
it.transform(transform {
|
it.transform(transform {
|
||||||
translate(1280 / 2.0, 720.0 / 2)
|
translate(drawer.bounds.center)
|
||||||
rotate(Vector3.Companion.UNIT_Z, seconds * 45.0 - 30.0)
|
rotate(Vector3.Companion.UNIT_Z, seconds * 45.0 - 30.0)
|
||||||
translate(-1280 / 2.0, -720.0 / 2.0)
|
translate(-drawer.bounds.center)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -58,5 +57,4 @@ fun main() {
|
|||||||
drawer.image(df0)
|
drawer.image(df0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -9,12 +9,10 @@ import org.openrndr.extra.jumpfill.draw.SDFStrokeFill
|
|||||||
import org.openrndr.extra.jumpfill.ops.SDFSmoothDifference
|
import org.openrndr.extra.jumpfill.ops.SDFSmoothDifference
|
||||||
import org.openrndr.extra.svg.loadSVG
|
import org.openrndr.extra.svg.loadSVG
|
||||||
|
|
||||||
|
fun main() = application {
|
||||||
fun main() {
|
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 1280
|
width = 720
|
||||||
height = 720
|
height = 405
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
val sdf0 = ShapeSDF()
|
val sdf0 = ShapeSDF()
|
||||||
@@ -51,5 +49,4 @@ fun main() {
|
|||||||
drawer.image(df0)
|
drawer.image(df0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -11,12 +11,10 @@ import org.openrndr.extra.jumpfill.ops.SDFSmoothDifference
|
|||||||
import org.openrndr.extra.svg.loadSVG
|
import org.openrndr.extra.svg.loadSVG
|
||||||
import org.openrndr.shape.Circle
|
import org.openrndr.shape.Circle
|
||||||
|
|
||||||
|
fun main() = application {
|
||||||
fun main() {
|
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 1280
|
width = 720
|
||||||
height = 720
|
height = 405
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
val gui = GUI()
|
val gui = GUI()
|
||||||
@@ -30,7 +28,7 @@ fun main() {
|
|||||||
|
|
||||||
val uvmap = colorBuffer(width, height, type = ColorType.FLOAT16)
|
val uvmap = colorBuffer(width, height, type = ColorType.FLOAT16)
|
||||||
|
|
||||||
val circleShapes = List(1) { Circle(width/2.0, height/2.0, 200.0).shape}
|
val circleShapes = List(1) { Circle(drawer.bounds.center, 200.0).shape }
|
||||||
val shapes = loadSVG("orx-jumpflood/src/jvmDemo/resources/name.svg").findShapes().map { it.shape }
|
val shapes = loadSVG("orx-jumpflood/src/jvmDemo/resources/name.svg").findShapes().map { it.shape }
|
||||||
|
|
||||||
sdf0.setShapes(circleShapes)
|
sdf0.setShapes(circleShapes)
|
||||||
@@ -58,5 +56,4 @@ fun main() {
|
|||||||
drawer.image(df0)
|
drawer.image(df0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -11,15 +11,13 @@ import org.openrndr.extra.jumpfill.ops.SDFSmoothDifference
|
|||||||
import org.openrndr.extra.svg.loadSVG
|
import org.openrndr.extra.svg.loadSVG
|
||||||
import org.openrndr.math.Vector2
|
import org.openrndr.math.Vector2
|
||||||
import org.openrndr.shape.Circle
|
import org.openrndr.shape.Circle
|
||||||
|
|
||||||
import kotlin.math.cos
|
import kotlin.math.cos
|
||||||
import kotlin.math.sin
|
import kotlin.math.sin
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 1280
|
width = 720
|
||||||
height = 720
|
height = 405
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
val gui = GUI()
|
val gui = GUI()
|
||||||
@@ -35,7 +33,7 @@ fun main() {
|
|||||||
val uvmap = colorBuffer(width, height, type = ColorType.FLOAT16)
|
val uvmap = colorBuffer(width, height, type = ColorType.FLOAT16)
|
||||||
val uvmap2 = colorBuffer(width, height, type = ColorType.FLOAT16)
|
val uvmap2 = colorBuffer(width, height, type = ColorType.FLOAT16)
|
||||||
|
|
||||||
val circleShapes = List(1) { Circle(width/2.0, height/2.0, 200.0).shape}
|
val circleShapes = List(1) { Circle(drawer.bounds.center, 200.0).shape }
|
||||||
val shapes = loadSVG("orx-jumpflood/src/jvmDemo/resources/name.svg").findShapes().map { it.shape }
|
val shapes = loadSVG("orx-jumpflood/src/jvmDemo/resources/name.svg").findShapes().map { it.shape }
|
||||||
|
|
||||||
sdf0.setShapes(circleShapes)
|
sdf0.setShapes(circleShapes)
|
||||||
@@ -53,7 +51,7 @@ fun main() {
|
|||||||
extend {
|
extend {
|
||||||
drawer.clear(ColorRGBa.PINK)
|
drawer.clear(ColorRGBa.PINK)
|
||||||
|
|
||||||
perturb.offset = Vector2(cos(seconds*0.2), sin(seconds*0.2))
|
perturb.offset = Vector2(cos(seconds * 0.2), sin(seconds * 0.2))
|
||||||
perturb.outputUV = true
|
perturb.outputUV = true
|
||||||
perturb.phase = seconds * 0.1
|
perturb.phase = seconds * 0.1
|
||||||
perturb.apply(uvmap, uvmap)
|
perturb.apply(uvmap, uvmap)
|
||||||
@@ -72,5 +70,4 @@ fun main() {
|
|||||||
drawer.image(df0)
|
drawer.image(df0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -7,11 +7,10 @@ import org.openrndr.draw.renderTarget
|
|||||||
import org.openrndr.extra.jumpfill.fx.Skeleton
|
import org.openrndr.extra.jumpfill.fx.Skeleton
|
||||||
import org.openrndr.extra.noise.simplex
|
import org.openrndr.extra.noise.simplex
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 1280
|
width = 720
|
||||||
height = 720
|
height = 540
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
val skeleton = Skeleton()
|
val skeleton = Skeleton()
|
||||||
@@ -34,7 +33,7 @@ fun main() {
|
|||||||
val time = seconds * 0.25
|
val time = seconds * 0.25
|
||||||
val x = simplex(i * 20, time) * width / 2 + width / 2
|
val x = simplex(i * 20, time) * width / 2 + width / 2
|
||||||
val y = simplex(i * 20 + 5, time) * height / 2 + height / 2
|
val y = simplex(i * 20 + 5, time) * height / 2 + height / 2
|
||||||
val r = simplex(i*30, time) * 50.0 + 50.0
|
val r = simplex(i * 30, time) * 50.0 + 50.0
|
||||||
drawer.circle(x, y, r)
|
drawer.circle(x, y, r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -42,5 +41,4 @@ fun main() {
|
|||||||
drawer.image(field)
|
drawer.image(field)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -2,16 +2,14 @@ import org.openrndr.application
|
|||||||
import org.openrndr.color.ColorRGBa
|
import org.openrndr.color.ColorRGBa
|
||||||
import org.openrndr.draw.ColorType
|
import org.openrndr.draw.ColorType
|
||||||
import org.openrndr.draw.createEquivalent
|
import org.openrndr.draw.createEquivalent
|
||||||
|
|
||||||
import org.openrndr.draw.isolatedWithTarget
|
import org.openrndr.draw.isolatedWithTarget
|
||||||
import org.openrndr.draw.renderTarget
|
import org.openrndr.draw.renderTarget
|
||||||
import org.openrndr.extra.jumpfill.fx.StraightSkeleton
|
import org.openrndr.extra.jumpfill.fx.StraightSkeleton
|
||||||
import org.openrndr.extra.noise.simplex
|
import org.openrndr.extra.noise.simplex
|
||||||
|
|
||||||
fun main() {
|
fun main() = application {
|
||||||
application {
|
|
||||||
configure {
|
configure {
|
||||||
width = 1280
|
width = 720
|
||||||
height = 720
|
height = 720
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
@@ -35,7 +33,7 @@ fun main() {
|
|||||||
val time = seconds * 0.25
|
val time = seconds * 0.25
|
||||||
val x = simplex(i * 20, time) * width / 2 + width / 2
|
val x = simplex(i * 20, time) * width / 2 + width / 2
|
||||||
val y = simplex(i * 20 + 5, time) * height / 2 + height / 2
|
val y = simplex(i * 20 + 5, time) * height / 2 + height / 2
|
||||||
val r = simplex(i*30, time) * 50.0 + 50.0
|
val r = simplex(i * 30, time) * 50.0 + 50.0
|
||||||
drawer.circle(x, y, r)
|
drawer.circle(x, y, r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,5 +41,4 @@ fun main() {
|
|||||||
drawer.image(field)
|
drawer.image(field)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -13,14 +13,14 @@ fun main() = application {
|
|||||||
height = 512
|
height = 512
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
val rt = renderTarget(512, 512, 1.0) {
|
val rt = renderTarget(width, height, 1.0) {
|
||||||
colorBuffer(type = ColorType.FLOAT32)
|
colorBuffer(type = ColorType.FLOAT32)
|
||||||
}
|
}
|
||||||
val encoder = EncodePoints()
|
val encoder = EncodePoints()
|
||||||
val jf = JumpFlooder(512, 512, encodePoints = Passthrough())
|
val jf = JumpFlooder(width, height, encodePoints = Passthrough())
|
||||||
val jf2 = JumpFlooder(512, 512, encodePoints = Passthrough())
|
val jf2 = JumpFlooder(width, height, encodePoints = Passthrough())
|
||||||
val idcontours = IdContourPoints()
|
val idcontours = IdContourPoints()
|
||||||
val contoured = colorBuffer(512, 512, type = ColorType.FLOAT32)
|
val contoured = colorBuffer(width, height, type = ColorType.FLOAT32)
|
||||||
extend {
|
extend {
|
||||||
fun plot(x: Double, y: Double, id: Double) {
|
fun plot(x: Double, y: Double, id: Double) {
|
||||||
drawer.fill = ColorRGBa(id, 0.0, 0.0, 1.0)
|
drawer.fill = ColorRGBa(id, 0.0, 0.0, 1.0)
|
||||||
@@ -53,7 +53,7 @@ fun main() = application {
|
|||||||
drawer.image(contoured)
|
drawer.image(contoured)
|
||||||
val flooded2 = jf2.jumpFlood(contoured)
|
val flooded2 = jf2.jumpFlood(contoured)
|
||||||
|
|
||||||
drawer.image(flooded2, 512.0, 0.0)
|
drawer.image(flooded2, width * 1.0, 0.0)
|
||||||
|
|
||||||
drawer.shadeStyle = shadeStyle {
|
drawer.shadeStyle = shadeStyle {
|
||||||
fragmentTransform = """
|
fragmentTransform = """
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ fun main() = application {
|
|||||||
height = 512
|
height = 512
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
val rt = renderTarget(512, 512, 1.0) {
|
val rt = renderTarget(width, height, 1.0) {
|
||||||
colorBuffer(type = ColorType.FLOAT32)
|
colorBuffer(type = ColorType.FLOAT32)
|
||||||
}
|
}
|
||||||
|
|
||||||
val flowfield = colorBuffer(512, 512, type = ColorType.FLOAT32)
|
val flowfield = colorBuffer(width, height, type = ColorType.FLOAT32)
|
||||||
val cluster = ClusteredField(decodeMode = DecodeMode.DISTANCE, outputDistanceToContours = true)
|
val cluster = ClusteredField(decodeMode = DecodeMode.DISTANCE, outputDistanceToContours = true)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import org.openrndr.math.Vector2
|
|||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
configure {
|
configure {
|
||||||
width = 720
|
width = 512
|
||||||
height = 720
|
height = 512
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
val rt = renderTarget(720, 720, 1.0) {
|
val rt = renderTarget(width, height, 1.0) {
|
||||||
colorBuffer(type = ColorType.FLOAT32)
|
colorBuffer(type = ColorType.FLOAT32)
|
||||||
}
|
}
|
||||||
val flowfield = colorBuffer(width, height, type = ColorType.FLOAT32)
|
val flowfield = colorBuffer(width, height, type = ColorType.FLOAT32)
|
||||||
@@ -28,9 +28,9 @@ fun main() = application {
|
|||||||
val points = drawer.bounds.scatter(20.0)
|
val points = drawer.bounds.scatter(20.0)
|
||||||
drawer.points {
|
drawer.points {
|
||||||
for ((index, point) in points.withIndex()) {
|
for ((index, point) in points.withIndex()) {
|
||||||
fill = ColorRGBa((index+1.0)/points.size, 0.0, 0.0, 1.0)
|
fill = ColorRGBa((index + 1.0) / points.size, 0.0, 0.0, 1.0)
|
||||||
for (i in 0 until 30) {
|
for (i in 0 until 30) {
|
||||||
point(point + Vector2.uniformRing(15.0, 25.0)* Vector2(1.0, 1.0))
|
point(point + Vector2.uniformRing(15.0, 25.0) * Vector2(1.0, 1.0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 1280 720" xml:space="preserve">
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<polygon fill="#FF00FF" stroke="#000000" stroke-miterlimit="2.6131" points="1013.8,424.3 1013.8,238 957.1,238 957.1,238
|
<svg width="720" height="405" version="1.1" viewBox="0 0 720 405" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g fill="#f0f">
|
||||||
794.7,238 794.7,294.7 957.1,294.7 957.1,318.9 794.7,318.9 794.7,375.6 957.1,375.6 957.1,424.3 794.7,424.3 794.7,481 957.1,481
|
<path d="m538 166v13.6h-91.3v31.8h91.3v27.3h-91.3v31.8h137v-31.8h-13.5v-104h-123v31.8z" stroke="#000" stroke-miterlimit="2.61"/>
|
||||||
1013.8,481 1037.8,481 1037.8,424.3 "/>
|
<path d="m397 148h-72.9v-13.6h-31.9v90.8h52.4v13.6h-52.4v31.8h137v-31.8h-52.4v-13.6h52.4v-90.8h-31.9zm0 45.4h-72.9v-13.6h72.9z" stroke="#000" stroke-miterlimit="2.61"/>
|
||||||
<path fill="#FF00FF" stroke="#000000" stroke-miterlimit="2.6131" d="M705.7,263.3H576V239h-56.7v119.2l0,0V401h93.2v24.3h-93.2V482
|
<path d="m201 157"/>
|
||||||
h243.1v-56.7h-93.2V401h93.2V239h-56.7V263.3L705.7,263.3z M705.7,344.3H576V320h129.7V344.3z"/>
|
<path d="m201 157c-5.17-1.85-10.7-2.8-16.2-2.8-26.5 0-48 21.5-48 47.9 0 26.5 21.5 47.9 48 47.9 26.5 0 48-21.5 48-47.9v-0.224c0-20.2-12.8-38.2-31.9-44.9zm-16.2 60.8c-8.82 0-16-7.12-16-15.9s7.14-15.9 16-15.9c8.77 0 16 7.12 16 15.9-0.0562 8.8-7.19 15.9-16 15.9z" stroke="#000" stroke-miterlimit="2.61"/>
|
||||||
<path fill="#FF00FF" d="M356.6,279L356.6,279L356.6,279z"/>
|
<rect x="242" y="134" width="31.9" height="136" stroke="#000" stroke-miterlimit="2.61"/>
|
||||||
<path fill="#FF00FF" stroke="#000000" stroke-miterlimit="2.6131" d="M356.6,279c-9.2-3.3-19-5-28.8-5c-47.2,0-85.5,38.3-85.5,85.5
|
</g></svg>
|
||||||
s38.3,85.5,85.5,85.5s85.5-38.3,85.5-85.5c0-0.1,0-0.3,0-0.4C413.3,323.1,390.5,291,356.6,279z M327.8,387.4
|
|
||||||
c-15.7,0-28.4-12.7-28.4-28.4c0-15.7,12.7-28.4,28.4-28.4c15.6,0,28.4,12.7,28.4,28.4C356.1,374.7,343.4,387.4,327.8,387.4z"/>
|
|
||||||
<rect x="430.1" y="238" fill="#FF00FF" stroke="#000000" stroke-miterlimit="2.6131" width="56.7" height="243"/>
|
|
||||||
</svg>
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 897 B |
@@ -16,6 +16,12 @@ fun main() = application {
|
|||||||
program {
|
program {
|
||||||
var time = 0.0
|
var time = 0.0
|
||||||
|
|
||||||
|
if (System.getProperty("takeScreenshot") == "true") {
|
||||||
|
extensions.filterIsInstance<SingleScreenshot>().forEach {
|
||||||
|
it.delayFrames = 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
// By default OPENRNDR clears the canvas on each animation
|
// By default OPENRNDR clears the canvas on each animation
|
||||||
// frame. NoClear disables that behavior, letting you
|
// frame. NoClear disables that behavior, letting you
|
||||||
@@ -29,11 +35,6 @@ fun main() = application {
|
|||||||
backdrop = { drawer.clear(rgb(0.15)) }
|
backdrop = { drawer.clear(rgb(0.15)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (System.getProperty("takeScreenshot") == "true") {
|
|
||||||
extensions.filterIsInstance<SingleScreenshot>().forEach {
|
|
||||||
it.delayFrames = 60
|
|
||||||
}
|
|
||||||
}
|
|
||||||
extend {
|
extend {
|
||||||
// Draw something. For this demo *what* you draw is not so
|
// Draw something. For this demo *what* you draw is not so
|
||||||
// important, only the fact that it stays on the canvas
|
// important, only the fact that it stays on the canvas
|
||||||
|
|||||||
Reference in New Issue
Block a user