From 700b666e5ca9a97efaeeff442a40ea3ebe1f00e9 Mon Sep 17 00:00:00 2001 From: Abe Pazos Date: Wed, 27 Aug 2025 18:32:18 +0000 Subject: [PATCH] add demos to README.md --- orx-camera/README.md | 64 +++++- orx-color/README.md | 226 ++++++++++++++++---- orx-composition/README.md | 51 ++++- orx-compositor/README.md | 19 +- orx-delegate-magic/README.md | 38 +++- orx-easing/README.md | 7 +- orx-envelopes/README.md | 8 +- orx-expression-evaluator/README.md | 11 +- orx-fcurve/README.md | 16 +- orx-fft/README.md | 5 +- orx-fx/README.md | 111 +++++++--- orx-hash-grid/README.md | 33 ++- orx-image-fit/README.md | 8 +- orx-integral-image/README.md | 10 +- orx-jumpflood/README.md | 81 +++++-- orx-kdtree/README.md | 44 +++- orx-marching-squares/README.md | 16 +- orx-math/README.md | 37 +++- orx-mesh-generators/README.md | 80 +++++-- orx-mesh-noise/README.md | 52 ++++- orx-no-clear/README.md | 4 +- orx-noise/README.md | 216 +++++++++++++++---- orx-obj-loader/README.md | 22 +- orx-property-watchers/README.md | 8 +- orx-quadtree/README.md | 8 +- orx-shade-styles/README.md | 110 +++++++--- orx-shapes/README.md | 327 ++++++++++++++++++++++------- orx-temporal-blur/README.md | 8 +- orx-text-on-contour/README.md | 8 +- orx-text-writer/README.md | 27 ++- orx-time-operators/README.md | 8 +- orx-timer/README.md | 14 +- orx-triangulation/README.md | 44 +++- orx-turtle/README.md | 19 +- orx-view-box/README.md | 46 +++- 35 files changed, 1430 insertions(+), 356 deletions(-) diff --git a/orx-camera/README.md b/orx-camera/README.md index e1e87dd0..876a754f 100644 --- a/orx-camera/README.md +++ b/orx-camera/README.md @@ -59,36 +59,78 @@ fun main() = application { ## Demos ### DemoCamera2D01 -[source code](src/jvmDemo/kotlin/DemoCamera2D01.kt) +# Camera2D demo + +click and drag the mouse for panning, use the mouse wheel for zooming ![DemoCamera2D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-camera/images/DemoCamera2D01Kt.png) -### DemoCamera2D02 -[source code](src/jvmDemo/kotlin/DemoCamera2D02.kt) +[source code](src/jvmDemo/kotlin/DemoCamera2D01.kt) +### DemoCamera2D02 + +# Camera2D demo with static elements + +An approach for having certain elements not affected by the camera ![DemoCamera2D02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-camera/images/DemoCamera2D02Kt.png) -### DemoCamera2DManual01 -[source code](src/jvmDemo/kotlin/DemoCamera2DManual01.kt) +[source code](src/jvmDemo/kotlin/DemoCamera2D02.kt) +### DemoCamera2DManual01 + +Demonstrate the use of `Camera2DManual` for manual camera control. + +The application is configured with a 720x720 window size. Within the program, a custom camera (`Camera2DManual`) +is initialized and used to create isolated drawing scopes. The `isolated` method is used to overlay different +drawing operations while maintaining individual camera states, ensuring proper transformations for specific elements. + +Three circles are drawn on the canvas: a small pink one, a medium white one and a large pink one. +Only the pink ones are affected by the interactive `Camera2DManual`, while the middle white circle is outside +the camera's isolated scope. ![DemoCamera2DManual01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-camera/images/DemoCamera2DManual01Kt.png) -### DemoCamera2DManual02 -[source code](src/jvmDemo/kotlin/DemoCamera2DManual02.kt) +[source code](src/jvmDemo/kotlin/DemoCamera2DManual01.kt) +### DemoCamera2DManual02 + +Demonstrate the use of `Camera2DManual` to independently translate, scale and rotate one contour +in a collection. + +When the mouse is clicked, the active contour is transformed using the camera view matrix, +then the camera is reset to its default state and whatever shape is under the mouse becomes +the new active contour. + +As the mouse is dragged or its wheel scrolled, the camera is updated, affecting +how the active contour is rendered. ![DemoCamera2DManual02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-camera/images/DemoCamera2DManual02Kt.png) +[source code](src/jvmDemo/kotlin/DemoCamera2DManual02.kt) + ### DemoOrbitalCamera01 -[source code](src/jvmDemo/kotlin/DemoOrbitalCamera01.kt) + ![DemoOrbitalCamera01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-camera/images/DemoOrbitalCamera01Kt.png) -### DemoOrbitalManual01 -[source code](src/jvmDemo/kotlin/DemoOrbitalManual01.kt) +[source code](src/jvmDemo/kotlin/DemoOrbitalCamera01.kt) +### DemoOrbitalManual01 + +Demonstrate the use of an orbital camera to render a sphere and a cube in 3D space as wireframe meshes, positioned +and rendered independently using the camera's isolated drawing state. A stationary pink circle is also drawn in the +center of the scene. + +Functionality: +- Initializes a sphere mesh and a cube mesh with predefined dimensions. +- Spawns an orbital camera, initially positioned away from the origin, to allow for focused rendering. +- Renders 3D wireframe shapes (sphere and cube) using the camera's isolated perspective. +- Draws a static 2D pink circle overlay at the window center. ![DemoOrbitalManual01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-camera/images/DemoOrbitalManual01Kt.png) +[source code](src/jvmDemo/kotlin/DemoOrbitalManual01.kt) + ### DemoParametricOrbital01 -[source code](src/jvmDemo/kotlin/DemoParametricOrbital01.kt) + ![DemoParametricOrbital01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-camera/images/DemoParametricOrbital01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoParametricOrbital01.kt) diff --git a/orx-color/README.md b/orx-color/README.md index 4e78e134..3baad1a0 100644 --- a/orx-color/README.md +++ b/orx-color/README.md @@ -50,156 +50,300 @@ Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an impleme ## Demos ### colormap/DemoSpectralZucconiColormap -[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormap.kt) + ![colormap-DemoSpectralZucconiColormapKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormap-DemoSpectralZucconiColormapKt.png) +[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormap.kt) + ### colormap/DemoSpectralZucconiColormapPhrase -[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormapPhrase.kt) + ![colormap-DemoSpectralZucconiColormapPhraseKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormap-DemoSpectralZucconiColormapPhraseKt.png) +[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormapPhrase.kt) + ### colormap/DemoSpectralZucconiColormapPlot -[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormapPlot.kt) + ![colormap-DemoSpectralZucconiColormapPlotKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormap-DemoSpectralZucconiColormapPlotKt.png) +[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormapPlot.kt) + ### colormap/DemoTurboColormap -[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormap.kt) + ![colormap-DemoTurboColormapKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormap-DemoTurboColormapKt.png) +[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormap.kt) + ### colormap/DemoTurboColormapPhrase -[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormapPhrase.kt) + ![colormap-DemoTurboColormapPhraseKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormap-DemoTurboColormapPhraseKt.png) +[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormapPhrase.kt) + ### colormap/DemoTurboColormapPlot -[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormapPlot.kt) + ![colormap-DemoTurboColormapPlotKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormap-DemoTurboColormapPlotKt.png) -### colormatrix/DemoColorMatrix01 -[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix01.kt) +[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormapPlot.kt) +### colormatrix/DemoColorMatrix01 + +This demo modifies the displayed image in each grid cell +using color matrix transformations to demonstrate color channel inversions based on +the grid cell's index. The image is adjusted to fit within each grid cell while maintaining +alignment. + +Functionality: +- Loads an image from the specified file path. +- Splits the drawing area into an evenly spaced 4x2 grid. +- Applies different color matrix inversions (red, green, blue) based on the position index. +- Fits the image into each grid cell while providing horizontal alignment adjustments. ![colormatrix-DemoColorMatrix01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormatrix-DemoColorMatrix01Kt.png) -### colormatrix/DemoColorMatrix02 -[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix02.kt) +[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix01.kt) +### colormatrix/DemoColorMatrix02 + +This demo modifies the displayed image in each grid cell +using color matrix transformations to demonstrate color channel inversions based on +the grid cell's index. The image is adjusted to fit within each grid cell while maintaining +alignment. + +Functionality: +- Loads an image from the specified file path. +- Splits the drawing area into an evenly spaced 4x2 grid. +- Applies different color matrix inversions (red, green, blue) based on the position index. +- Fits the image into each grid cell while providing horizontal alignment adjustments. ![colormatrix-DemoColorMatrix02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormatrix-DemoColorMatrix02Kt.png) -### colormatrix/DemoColorMatrix03 -[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix03.kt) +[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix02.kt) +### colormatrix/DemoColorMatrix03 + +Entry point for an application demonstrating the use of color matrix transformations on an image. + +The program initializes a graphical application with a resolution of 720x720 pixels +and processes an image to display it in a series of grid cells, applying a hue shift +transformation based on the index of each cell. + +Key features: +- Loads an image from a specified file path. +- Configures the drawing area to consist of a horizontal grid with 16 cells. +- Applies a color tint transformation utilizing the red channel, shifting its hue progressively +per cell index to create a colorful gradient effect. +- Adjusts the positions of the images within each grid cell for aesthetic alignment. ![colormatrix-DemoColorMatrix03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormatrix-DemoColorMatrix03Kt.png) -### colormatrix/DemoColorMatrix04 -[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix04.kt) +[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix03.kt) +### colormatrix/DemoColorMatrix04 + +Entry point of a graphical application that demonstrates the use of color matrix +transformations on an image displayed within a grid layout. + +Overview: +- Initializes a window with a resolution of 720x720 pixels. +- Loads an image from the specified file path. +- Splits the drawing canvas into a 7x1 grid of cells. +- In each grid cell, applies custom grayscale transformations to the image using +a color matrix. The grayscale transformation coefficients for red, green, and blue +channels are computed based on the index of the grid cell. +- Displays the adjusted image in each grid cell with horizontal alignment modifications +to position the images dynamically based on their index within the grid. ![colormatrix-DemoColorMatrix04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormatrix-DemoColorMatrix04Kt.png) +[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix04.kt) + ### colorRange/DemoColorRange01 -[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange01.kt) + ![colorRange-DemoColorRange01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colorRange-DemoColorRange01Kt.png) +[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange01.kt) + ### colorRange/DemoColorRange02 -[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange02.kt) + ![colorRange-DemoColorRange02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colorRange-DemoColorRange02Kt.png) +[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange02.kt) + ### colorRange/DemoColorRange03 -[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange03.kt) + ![colorRange-DemoColorRange03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colorRange-DemoColorRange03Kt.png) +[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange03.kt) + ### colorRange/DemoColorRange04 -[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange04.kt) + ![colorRange-DemoColorRange04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colorRange-DemoColorRange04Kt.png) -### DemoColorPalette01 -[source code](src/jvmDemo/kotlin/DemoColorPalette01.kt) +[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange04.kt) +### DemoColorPalette01 + +Demonstrates the creation of color palettes using various available methods ![DemoColorPalette01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoColorPalette01Kt.png) -### DemoColorPalette02 -[source code](src/jvmDemo/kotlin/DemoColorPalette02.kt) +[source code](src/jvmDemo/kotlin/DemoColorPalette01.kt) +### DemoColorPalette02 + +By default, generated palettes contain colors of varying hue +but similar brightness and saturation. +Here we alter the brightness of each color using .shade() for +an increased dynamic range. ![DemoColorPalette02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoColorPalette02Kt.png) +[source code](src/jvmDemo/kotlin/DemoColorPalette02.kt) + ### DemoColorPlane01 -[source code](src/jvmDemo/kotlin/DemoColorPlane01.kt) + ![DemoColorPlane01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoColorPlane01Kt.png) +[source code](src/jvmDemo/kotlin/DemoColorPlane01.kt) + ### DemoColorPlane02 -[source code](src/jvmDemo/kotlin/DemoColorPlane02.kt) + ![DemoColorPlane02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoColorPlane02Kt.png) -### DemoColorSequence01 -[source code](src/jvmDemo/kotlin/DemoColorSequence01.kt) +[source code](src/jvmDemo/kotlin/DemoColorPlane02.kt) +### DemoColorSequence01 + +A demo that demonstrates 3D objects with custom shading and color gradients. + +The application setup involves: +- Configuring the application window dimensions. +- Creating a color gradient using `ColorSequence` and converting it to a `ColorBuffer` for shading purposes. +- Defining a 3D sphere mesh with specified resolution. + +The rendering process includes: +- Setting up an orbital camera extension to provide an interactive 3D view. +- 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. ![DemoColorSequence01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoColorSequence01Kt.png) +[source code](src/jvmDemo/kotlin/DemoColorSequence01.kt) + ### DemoDeltaE -[source code](src/jvmDemo/kotlin/DemoDeltaE.kt) + ![DemoDeltaEKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoDeltaEKt.png) +[source code](src/jvmDemo/kotlin/DemoDeltaE.kt) + ### DemoFettePalette01 -[source code](src/jvmDemo/kotlin/DemoFettePalette01.kt) + ![DemoFettePalette01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoFettePalette01Kt.png) +[source code](src/jvmDemo/kotlin/DemoFettePalette01.kt) + ### DemoFettePalette02 -[source code](src/jvmDemo/kotlin/DemoFettePalette02.kt) + ![DemoFettePalette02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoFettePalette02Kt.png) +[source code](src/jvmDemo/kotlin/DemoFettePalette02.kt) + ### DemoHSLUV01 -[source code](src/jvmDemo/kotlin/DemoHSLUV01.kt) + ![DemoHSLUV01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoHSLUV01Kt.png) +[source code](src/jvmDemo/kotlin/DemoHSLUV01.kt) + ### DemoHSLUV02 -[source code](src/jvmDemo/kotlin/DemoHSLUV02.kt) + ![DemoHSLUV02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoHSLUV02Kt.png) +[source code](src/jvmDemo/kotlin/DemoHSLUV02.kt) + ### DemoHueTools01 -[source code](src/jvmDemo/kotlin/DemoHueTools01.kt) + ![DemoHueTools01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoHueTools01Kt.png) +[source code](src/jvmDemo/kotlin/DemoHueTools01.kt) + ### DemoMixSpectral01 -[source code](src/jvmDemo/kotlin/DemoMixSpectral01.kt) + ![DemoMixSpectral01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoMixSpectral01Kt.png) +[source code](src/jvmDemo/kotlin/DemoMixSpectral01.kt) + ### DemoOKHSV01 -[source code](src/jvmDemo/kotlin/DemoOKHSV01.kt) + ![DemoOKHSV01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoOKHSV01Kt.png) +[source code](src/jvmDemo/kotlin/DemoOKHSV01.kt) + ### DemoXSLUV01 -[source code](src/jvmDemo/kotlin/DemoXSLUV01.kt) + ![DemoXSLUV01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/DemoXSLUV01Kt.png) -### histogram/DemoHistogram01 -[source code](src/jvmDemo/kotlin/histogram/DemoHistogram01.kt) +[source code](src/jvmDemo/kotlin/DemoXSLUV01.kt) +### histogram/DemoHistogram01 + +package histogram + +import org.openrndr.application +import org.openrndr.draw.loadImage +import org.openrndr.extra.color.statistics.calculateHistogramRGB + +/* +Demonstrates how to generate a palette with the top 32 colors +of a loaded image, sorted by luminosity. The colors are displayed +as rectangles overlayed on top of the image. ![histogram-DemoHistogram01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/histogram-DemoHistogram01Kt.png) -### histogram/DemoHistogram02 -[source code](src/jvmDemo/kotlin/histogram/DemoHistogram02.kt) +[source code](src/jvmDemo/kotlin/histogram/DemoHistogram01.kt) +### histogram/DemoHistogram02 + +package histogram + +import org.openrndr.application +import org.openrndr.draw.loadImage +import org.openrndr.extra.color.statistics.calculateHistogramRGB +import kotlin.math.pow + +/* +Show the color histogram of an image using non-uniform weighting, +prioritizing bright colors. ![histogram-DemoHistogram02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/histogram-DemoHistogram02Kt.png) -### histogram/DemoHistogram03 -[source code](src/jvmDemo/kotlin/histogram/DemoHistogram03.kt) +[source code](src/jvmDemo/kotlin/histogram/DemoHistogram02.kt) +### histogram/DemoHistogram03 + +package histogram + +import org.openrndr.application +import org.openrndr.draw.loadImage +import org.openrndr.extra.color.statistics.calculateHistogramRGB + +/* +Create a simple grid-like composition based on colors sampled from image. +The cells are 32 by 32 pixels in size and are filled with a random sample +taken from the color histogram of the image. + +Note: due to its random nature the resulting animation contains flickering colors. ![histogram-DemoHistogram03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/histogram-DemoHistogram03Kt.png) + +[source code](src/jvmDemo/kotlin/histogram/DemoHistogram03.kt) diff --git a/orx-composition/README.md b/orx-composition/README.md index 745948ef..a8eada3f 100644 --- a/orx-composition/README.md +++ b/orx-composition/README.md @@ -17,26 +17,61 @@ _The code in `orx-composition` was previously found under `openrndr-draw` in the ## Demos ### DemoCompositionDrawer01 -[source code](src/jvmDemo/kotlin/DemoCompositionDrawer01.kt) +Demonstrates how to + +- Create a Composition +- Draw it on the program window +- Save it to an SVG file +- Print the SVG content as text ![DemoCompositionDrawer01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-composition/images/DemoCompositionDrawer01Kt.png) -### DemoCompositionDrawer02 -[source code](src/jvmDemo/kotlin/DemoCompositionDrawer02.kt) +[source code](src/jvmDemo/kotlin/DemoCompositionDrawer01.kt) +### DemoCompositionDrawer02 + +Demonstrates how to draw a Composition and how to use +`ClipMode.REVERSE_DIFFERENCE` to clip shapes. + +The first shape clips part of the second one away, +producing a shape that seems to be behind the first one. + +Without clipping, the second circle would cover part of the first one. ![DemoCompositionDrawer02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-composition/images/DemoCompositionDrawer02Kt.png) +[source code](src/jvmDemo/kotlin/DemoCompositionDrawer02.kt) + ### DemoCompositionDrawer03 -[source code](src/jvmDemo/kotlin/DemoCompositionDrawer03.kt) + +Draws a composition using 3 circles and `ClipMode.REVERSE_DIFFERENCE`. + +A println() demonstrates that the result contains 3 shapes: +a complete circle, a moon-like shape, and a shape with two small black areas. + +One way to verify this is by saving the design as an SVG file and opening +it in vector editing software. ![DemoCompositionDrawer03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-composition/images/DemoCompositionDrawer03Kt.png) -### DemoCompositionDrawer04 -[source code](src/jvmDemo/kotlin/DemoCompositionDrawer04.kt) +[source code](src/jvmDemo/kotlin/DemoCompositionDrawer03.kt) +### DemoCompositionDrawer04 + +Demonstrates how to add content to and how to clear an existing Composition. + +A number of circles are added when the program starts. +Dragging the mouse button adds more circles. +Right-clicking the mouse clears the Composition. ![DemoCompositionDrawer04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-composition/images/DemoCompositionDrawer04Kt.png) -### DemoCompositionDrawer05 -[source code](src/jvmDemo/kotlin/DemoCompositionDrawer05.kt) +[source code](src/jvmDemo/kotlin/DemoCompositionDrawer04.kt) +### DemoCompositionDrawer05 + +Demonstrates how to + +- Create a Composition with a group +- Add XML attributes so the group appears as a layer in Inkscape ![DemoCompositionDrawer05Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-composition/images/DemoCompositionDrawer05Kt.png) + +[source code](src/jvmDemo/kotlin/DemoCompositionDrawer05.kt) diff --git a/orx-compositor/README.md b/orx-compositor/README.md index e839bac2..72a92914 100644 --- a/orx-compositor/README.md +++ b/orx-compositor/README.md @@ -238,16 +238,25 @@ fun main() = application { ## Demos ### DemoAside01 -[source code](src/jvmDemo/kotlin/DemoAside01.kt) + ![DemoAside01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-compositor/images/DemoAside01Kt.png) -### DemoCompositor01 -[source code](src/jvmDemo/kotlin/DemoCompositor01.kt) +[source code](src/jvmDemo/kotlin/DemoAside01.kt) +### DemoCompositor01 + +Compositor demo showing 3 layers of moving items +with a different amount of blur in each layer, +simulating depth of field ![DemoCompositor01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-compositor/images/DemoCompositor01Kt.png) -### DemoCompositor02 -[source code](src/jvmDemo/kotlin/DemoCompositor02.kt) +[source code](src/jvmDemo/kotlin/DemoCompositor01.kt) +### DemoCompositor02 + +Demonstration of using [BufferMultisample] on a per layer basis. +Try changing which layer has multisampling applied and observe the results. ![DemoCompositor02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-compositor/images/DemoCompositor02Kt.png) + +[source code](src/jvmDemo/kotlin/DemoCompositor02.kt) diff --git a/orx-delegate-magic/README.md b/orx-delegate-magic/README.md index 1356f0af..c3c76b98 100644 --- a/orx-delegate-magic/README.md +++ b/orx-delegate-magic/README.md @@ -40,21 +40,49 @@ val radiusHistory by tracking(state::radius) ## Demos ### DemoDifferencing01 -[source code](src/jvmDemo/kotlin/DemoDifferencing01.kt) + ![DemoDifferencing01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-delegate-magic/images/DemoDifferencing01Kt.png) -### DemoFollowing01 -[source code](src/jvmDemo/kotlin/DemoFollowing01.kt) +[source code](src/jvmDemo/kotlin/DemoDifferencing01.kt) +### DemoFollowing01 + +Demonstrates using delegate-magic tools with +[Double] and [Vector2]. + +The white circle's position uses [following]. +The red circle's position uses [smoothing]. + +`following` uses physics (velocity and acceleration). +`smoothing` eases values towards the target. + +Variables using delegates (`by`) interpolate +toward target values, shown as gray lines. + +The behavior of the delegate-magic functions can be configured +via arguments that affect their output. + +The arguments come in pairs of similar name: +The first one, often of type [Double], is constant, +The second one contains `Property` in its name and can be +modified after its creation and even be linked to a UI +to modify the behavior of the delegate function in real time. +The `Property` argument overrides the other. ![DemoFollowing01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-delegate-magic/images/DemoFollowing01Kt.png) +[source code](src/jvmDemo/kotlin/DemoFollowing01.kt) + ### DemoSmoothing01 -[source code](src/jvmDemo/kotlin/DemoSmoothing01.kt) + ![DemoSmoothing01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-delegate-magic/images/DemoSmoothing01Kt.png) +[source code](src/jvmDemo/kotlin/DemoSmoothing01.kt) + ### DemoSpring01 -[source code](src/jvmDemo/kotlin/DemoSpring01.kt) + ![DemoSpring01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-delegate-magic/images/DemoSpring01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoSpring01.kt) diff --git a/orx-easing/README.md b/orx-easing/README.md index 7c9526b5..4c3dea89 100644 --- a/orx-easing/README.md +++ b/orx-easing/README.md @@ -94,6 +94,11 @@ println(Easing.values().size) ## Demos ### DemoEasings01 -[source code](src/jvmDemo/kotlin/DemoEasings01.kt) + +# Visualizes Easing types as a graph and as motion. + +[grid] is used to layout graphs on rows and columns. ![DemoEasings01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-easing/images/DemoEasings01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoEasings01.kt) diff --git a/orx-envelopes/README.md b/orx-envelopes/README.md index d8f1b2e9..c4db6541 100644 --- a/orx-envelopes/README.md +++ b/orx-envelopes/README.md @@ -8,11 +8,15 @@ Attack, decay, sustain, release ## Demos ### DemoADSRTracker01 -[source code](src/jvmDemo/kotlin/DemoADSRTracker01.kt) + ![DemoADSRTracker01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-envelopes/images/DemoADSRTracker01Kt.png) +[source code](src/jvmDemo/kotlin/DemoADSRTracker01.kt) + ### DemoADSRTracker02 -[source code](src/jvmDemo/kotlin/DemoADSRTracker02.kt) + ![DemoADSRTracker02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-envelopes/images/DemoADSRTracker02Kt.png) + +[source code](src/jvmDemo/kotlin/DemoADSRTracker02.kt) diff --git a/orx-expression-evaluator/README.md b/orx-expression-evaluator/README.md index ea473142..85f36123 100644 --- a/orx-expression-evaluator/README.md +++ b/orx-expression-evaluator/README.md @@ -83,11 +83,16 @@ xFunction(1.0) ## Demos ### DemoExpressionEvaluator01 -[source code](src/jvmDemo/kotlin/DemoExpressionEvaluator01.kt) + ![DemoExpressionEvaluator01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-expression-evaluator/images/DemoExpressionEvaluator01Kt.png) -### DemoExpressionEvaluator02 -[source code](src/jvmDemo/kotlin/DemoExpressionEvaluator02.kt) +[source code](src/jvmDemo/kotlin/DemoExpressionEvaluator01.kt) +### DemoExpressionEvaluator02 + +Improved version of DemoExpressionEvaluator01, it uses [watchingExpression1] to automatically convert an expression +string into a function with a parameter "t". ![DemoExpressionEvaluator02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-expression-evaluator/images/DemoExpressionEvaluator02Kt.png) + +[source code](src/jvmDemo/kotlin/DemoExpressionEvaluator02.kt) diff --git a/orx-fcurve/README.md b/orx-fcurve/README.md index 327ad49f..77ba1fed 100644 --- a/orx-fcurve/README.md +++ b/orx-fcurve/README.md @@ -201,21 +201,29 @@ For example `(M0 (h1 m1)[3])[2]` expands to `M0 h1 m1 h1 m1 h1 m1 M0 h1 m1 h1 m1 ## Demos ### DemoFCurve01 -[source code](src/jvmDemo/kotlin/DemoFCurve01.kt) + ![DemoFCurve01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fcurve/images/DemoFCurve01Kt.png) +[source code](src/jvmDemo/kotlin/DemoFCurve01.kt) + ### DemoFCurve02 -[source code](src/jvmDemo/kotlin/DemoFCurve02.kt) + ![DemoFCurve02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fcurve/images/DemoFCurve02Kt.png) +[source code](src/jvmDemo/kotlin/DemoFCurve02.kt) + ### DemoFCurveSheet01 -[source code](src/jvmDemo/kotlin/DemoFCurveSheet01.kt) + ![DemoFCurveSheet01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fcurve/images/DemoFCurveSheet01Kt.png) +[source code](src/jvmDemo/kotlin/DemoFCurveSheet01.kt) + ### DemoMultiFCurve01 -[source code](src/jvmDemo/kotlin/DemoMultiFCurve01.kt) + ![DemoMultiFCurve01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fcurve/images/DemoMultiFCurve01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoMultiFCurve01.kt) diff --git a/orx-fft/README.md b/orx-fft/README.md index 95999600..64f94d44 100644 --- a/orx-fft/README.md +++ b/orx-fft/README.md @@ -6,6 +6,9 @@ The FFT routine found in `orx-fft` is a Kotlin port of Minim's FFT routine. ## Demos ### DemoFFTShape01 -[source code](src/jvmDemo/kotlin/DemoFFTShape01.kt) +Demonstration of using FFT to filter a two-dimensional shape. Mouse xy-position is mapped +to lowpass and highpass settings of the filter. ![DemoFFTShape01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fft/images/DemoFFTShape01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoFFTShape01.kt) diff --git a/orx-fx/README.md b/orx-fx/README.md index 8aecad52..a43d9c81 100644 --- a/orx-fx/README.md +++ b/orx-fx/README.md @@ -194,101 +194,164 @@ shaping `curve` within this range: ## Demos ### DemoApproximateGaussianBlur01 -[source code](src/jvmDemo/kotlin/DemoApproximateGaussianBlur01.kt) + ![DemoApproximateGaussianBlur01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoApproximateGaussianBlur01Kt.png) +[source code](src/jvmDemo/kotlin/DemoApproximateGaussianBlur01.kt) + ### DemoBlur01 -[source code](src/jvmDemo/kotlin/DemoBlur01.kt) + ![DemoBlur01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoBlur01Kt.png) +[source code](src/jvmDemo/kotlin/DemoBlur01.kt) + ### DemoCannyEdgeDetector01 -[source code](src/jvmDemo/kotlin/DemoCannyEdgeDetector01.kt) + ![DemoCannyEdgeDetector01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoCannyEdgeDetector01Kt.png) +[source code](src/jvmDemo/kotlin/DemoCannyEdgeDetector01.kt) + ### DemoColorDuotone01 -[source code](src/jvmDemo/kotlin/DemoColorDuotone01.kt) + ![DemoColorDuotone01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoColorDuotone01Kt.png) +[source code](src/jvmDemo/kotlin/DemoColorDuotone01.kt) + ### DemoColorDuotoneGradient01 -[source code](src/jvmDemo/kotlin/DemoColorDuotoneGradient01.kt) + ![DemoColorDuotoneGradient01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoColorDuotoneGradient01Kt.png) +[source code](src/jvmDemo/kotlin/DemoColorDuotoneGradient01.kt) + ### DemoColormapGrayscale -[source code](src/jvmDemo/kotlin/DemoColormapGrayscale.kt) + ![DemoColormapGrayscaleKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoColormapGrayscaleKt.png) +[source code](src/jvmDemo/kotlin/DemoColormapGrayscale.kt) + ### DemoColormapSpectralZucconi -[source code](src/jvmDemo/kotlin/DemoColormapSpectralZucconi.kt) + ![DemoColormapSpectralZucconiKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoColormapSpectralZucconiKt.png) +[source code](src/jvmDemo/kotlin/DemoColormapSpectralZucconi.kt) + ### DemoColormapTurbo -[source code](src/jvmDemo/kotlin/DemoColormapTurbo.kt) + ![DemoColormapTurboKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoColormapTurboKt.png) +[source code](src/jvmDemo/kotlin/DemoColormapTurbo.kt) + ### DemoColorPosterize01 -[source code](src/jvmDemo/kotlin/DemoColorPosterize01.kt) + ![DemoColorPosterize01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoColorPosterize01Kt.png) +[source code](src/jvmDemo/kotlin/DemoColorPosterize01.kt) + ### DemoCompositeFilter01 -[source code](src/jvmDemo/kotlin/DemoCompositeFilter01.kt) + ![DemoCompositeFilter01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoCompositeFilter01Kt.png) -### DemoContour01 -[source code](src/jvmDemo/kotlin/DemoContour01.kt) +[source code](src/jvmDemo/kotlin/DemoCompositeFilter01.kt) +### DemoContour01 + +Demonstrate the Contour filter +@author Edwin Jakobs ![DemoContour01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoContour01Kt.png) +[source code](src/jvmDemo/kotlin/DemoContour01.kt) + ### DemoDirectionalBlur01 -[source code](src/jvmDemo/kotlin/DemoDirectionalBlur01.kt) + +Demonstrates how to use [DirectionalBlur] by creating a `direction` +ColorBuffer in which the red and green components of the pixels point +in various directions where to sample pixels from. All the pixel colors +of the ColorBuffer are set one by one using two for loops. + +Note the FLOAT32 color type of the buffer to allow for negative values, +so sampling can happen from every direction. + +Every 60 animation frames the `centerWindow` property is toggled +between true and false to demonstrate how the result changes. ![DemoDirectionalBlur01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoDirectionalBlur01Kt.png) -### DemoDirectionalDisplace01 -[source code](src/jvmDemo/kotlin/DemoDirectionalDisplace01.kt) +[source code](src/jvmDemo/kotlin/DemoDirectionalBlur01.kt) +### DemoDirectionalDisplace01 + +Demonstrate how to use [DirectionalDisplace]. + +The direction map is populated using `drawImage` instead of +pixel by pixel. A grid of circles is drawn, each circle with a +color based on simplex noise. The R and G channels of the colors +control the direction of the sampling. By animating the sampling +distance the result oscillates between no-effect and a noticeable one. ![DemoDirectionalDisplace01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoDirectionalDisplace01Kt.png) -### DemoDirectionalDisplace02 -[source code](src/jvmDemo/kotlin/DemoDirectionalDisplace02.kt) +[source code](src/jvmDemo/kotlin/DemoDirectionalDisplace01.kt) +### DemoDirectionalDisplace02 + +Demonstrate how to use [DirectionalDisplace]. + +The program draws 12 overlapping translucent circles on the +`direction` color buffer to produce new color combinations +on the overlapping areas. Those colors specify where the +`DirectionalDisplace` effect will sample pixels from. ![DemoDirectionalDisplace02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoDirectionalDisplace02Kt.png) +[source code](src/jvmDemo/kotlin/DemoDirectionalDisplace02.kt) + ### DemoDistortLenses01 -[source code](src/jvmDemo/kotlin/DemoDistortLenses01.kt) + ![DemoDistortLenses01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoDistortLenses01Kt.png) +[source code](src/jvmDemo/kotlin/DemoDistortLenses01.kt) + ### DemoDitherLumaHalftone01 -[source code](src/jvmDemo/kotlin/DemoDitherLumaHalftone01.kt) + ![DemoDitherLumaHalftone01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoDitherLumaHalftone01Kt.png) +[source code](src/jvmDemo/kotlin/DemoDitherLumaHalftone01.kt) + ### DemoFluidDistort01 -[source code](src/jvmDemo/kotlin/DemoFluidDistort01.kt) + ![DemoFluidDistort01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoFluidDistort01Kt.png) -### DemoOkLab01 -[source code](src/jvmDemo/kotlin/DemoOkLab01.kt) +[source code](src/jvmDemo/kotlin/DemoFluidDistort01.kt) +### DemoOkLab01 + +This demonstrates converting a [ColorBuffer] from and to (OK)LAB color space using the [RgbToOkLab] and [OkLabToRgb] +filters. The (OK)Lab representation is signed and requires a floating point representation. ![DemoOkLab01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoOkLab01Kt.png) +[source code](src/jvmDemo/kotlin/DemoOkLab01.kt) + ### DemoPost01 -[source code](src/jvmDemo/kotlin/DemoPost01.kt) + ![DemoPost01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoPost01Kt.png) +[source code](src/jvmDemo/kotlin/DemoPost01.kt) + ### DemoSpectralBlend01 -[source code](src/jvmDemo/kotlin/DemoSpectralBlend01.kt) + ![DemoSpectralBlend01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoSpectralBlend01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoSpectralBlend01.kt) diff --git a/orx-hash-grid/README.md b/orx-hash-grid/README.md index 8beaae0b..cd406b2a 100644 --- a/orx-hash-grid/README.md +++ b/orx-hash-grid/README.md @@ -68,16 +68,39 @@ val hashGrid = points.hashGrid(20.0) ## Demos ### DemoFilter01 -[source code](src/jvmDemo/kotlin/DemoFilter01.kt) + +The program performs the following steps: +- Generates 10,000 random points uniformly distributed within the drawable bounds. +- Filters the generated points to enforce a minimum distance of 20.0 units between them. +- Visualizes the filtered points as circles with a radius of 10.0 units on the canvas. ![DemoFilter01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-hash-grid/images/DemoFilter01Kt.png) -### DemoFilter3D01 -[source code](src/jvmDemo/kotlin/DemoFilter3D01.kt) +[source code](src/jvmDemo/kotlin/DemoFilter01.kt) +### DemoFilter3D01 + +This demo sets up and renders a 3D visualization of filtered random points displayed as small spheres. + +The program performs the following key steps: +- Generates 10,000 random 3D points within a ring defined by a minimum and maximum radius. +- Filters the points to ensure a minimum distance between any two points using a spatial hash grid. +- Creates a small sphere mesh that will be instanced for each filtered point. +- Sets up an orbital camera to allow viewing the 3D scene interactively. +- Renders the filtered points by translating the sphere mesh to each point's position and applying a shader that modifies the fragment color based on the view normal. ![DemoFilter3D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-hash-grid/images/DemoFilter3D01Kt.png) -### DemoHashGrid01 -[source code](src/jvmDemo/kotlin/DemoHashGrid01.kt) +[source code](src/jvmDemo/kotlin/DemoFilter3D01.kt) +### DemoHashGrid01 + +This demo sets up an interactive graphics application with a configurable +display window and visualization logic. It uses a `HashGrid` to manage points +in a 2D space and randomly generates points within the drawable area. These +points are then inserted into the grid if they satisfy certain spatial conditions. +The visual output includes: +- Rectangles representing the bounds of the cells in the grid. +- Circles representing the generated points. ![DemoHashGrid01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-hash-grid/images/DemoHashGrid01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoHashGrid01.kt) diff --git a/orx-image-fit/README.md b/orx-image-fit/README.md index 10c71f95..ae1ffc61 100644 --- a/orx-image-fit/README.md +++ b/orx-image-fit/README.md @@ -71,11 +71,15 @@ fun main() = application { ## Demos ### DemoImageFit01 -[source code](src/jvmDemo/kotlin/DemoImageFit01.kt) +Tests `drawer.imageFit()` with all FitMethods for portrait and landscape images. ![DemoImageFit01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-image-fit/images/DemoImageFit01Kt.png) +[source code](src/jvmDemo/kotlin/DemoImageFit01.kt) + ### DemoImageFitSub01 -[source code](src/jvmDemo/kotlin/DemoImageFitSub01.kt) + ![DemoImageFitSub01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-image-fit/images/DemoImageFitSub01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoImageFitSub01.kt) diff --git a/orx-integral-image/README.md b/orx-integral-image/README.md index 72afbf54..870f3448 100644 --- a/orx-integral-image/README.md +++ b/orx-integral-image/README.md @@ -5,11 +5,15 @@ CPU and GPU-based implementation for integral images (summed area tables) ## Demos ### DemoFII01 -[source code](src/demo/kotlin/DemoFII01.kt) +Apply box blurs with large windows ![DemoFII01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-integral-image/images/DemoFII01Kt.png) -### DemoFII02 -[source code](src/demo/kotlin/DemoFII02.kt) +[source code](src/demo/kotlin/DemoFII01.kt) +### DemoFII02 + +Implement an FM like video synthesizer using [FastIntegralImage] ![DemoFII02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-integral-image/images/DemoFII02Kt.png) + +[source code](src/demo/kotlin/DemoFII02.kt) diff --git a/orx-jumpflood/README.md b/orx-jumpflood/README.md index a339e17d..ef8124c9 100644 --- a/orx-jumpflood/README.md +++ b/orx-jumpflood/README.md @@ -156,76 +156,123 @@ fun main() = application { ## Demos ### DemoDirectionField01 -[source code](src/jvmDemo/kotlin/DemoDirectionField01.kt) +Shows how to use the [DirectionalField] filter. +Draws moving white shapes on black background, +then applies the DirectionalField filter which returns a [ColorBuffer] in which +the red and green components encode the direction to the closest black/white edge. + +Hold down a mouse button to see the raw animation. ![DemoDirectionField01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoDirectionField01Kt.png) -### DemoDirectionField02 -[source code](src/jvmDemo/kotlin/DemoDirectionField02.kt) +[source code](src/jvmDemo/kotlin/DemoDirectionField01.kt) +### DemoDirectionField02 + +Create directional distance field and demonstrate signed distance ![DemoDirectionField02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoDirectionField02Kt.png) -### DemoDistanceField01 -[source code](src/jvmDemo/kotlin/DemoDistanceField01.kt) +[source code](src/jvmDemo/kotlin/DemoDirectionField02.kt) +### DemoDistanceField01 + +Shows how to use the [DistanceField] filter. + +Draws moving white shapes on black background, +then applies the DistanceField filter which returns a [ColorBuffer] in which +the red component encodes the distance to the closest black/white edge. + +The value of the green component is negative when on the black background +and positive when inside white shapes. The sign is used in the [shadeStyle] to choose +between two colors. + +The inverse of the distance is used to obtain a non-linear brightness. + +Hold down a mouse button to see the raw animation. ![DemoDistanceField01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoDistanceField01Kt.png) +[source code](src/jvmDemo/kotlin/DemoDistanceField01.kt) + ### DemoInnerGlow01 -[source code](src/jvmDemo/kotlin/DemoInnerGlow01.kt) + ![DemoInnerGlow01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoInnerGlow01Kt.png) +[source code](src/jvmDemo/kotlin/DemoInnerGlow01.kt) + ### DemoInnerGlow02 -[source code](src/jvmDemo/kotlin/DemoInnerGlow02.kt) + ![DemoInnerGlow02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoInnerGlow02Kt.png) +[source code](src/jvmDemo/kotlin/DemoInnerGlow02.kt) + ### DemoShapeSDF01 -[source code](src/jvmDemo/kotlin/DemoShapeSDF01.kt) + ![DemoShapeSDF01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoShapeSDF01Kt.png) +[source code](src/jvmDemo/kotlin/DemoShapeSDF01.kt) + ### DemoShapeSDF02 -[source code](src/jvmDemo/kotlin/DemoShapeSDF02.kt) + ![DemoShapeSDF02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoShapeSDF02Kt.png) +[source code](src/jvmDemo/kotlin/DemoShapeSDF02.kt) + ### DemoShapeSDF03 -[source code](src/jvmDemo/kotlin/DemoShapeSDF03.kt) + ![DemoShapeSDF03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoShapeSDF03Kt.png) +[source code](src/jvmDemo/kotlin/DemoShapeSDF03.kt) + ### DemoShapeSDF04 -[source code](src/jvmDemo/kotlin/DemoShapeSDF04.kt) + ![DemoShapeSDF04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoShapeSDF04Kt.png) +[source code](src/jvmDemo/kotlin/DemoShapeSDF04.kt) + ### DemoShapeSDF05 -[source code](src/jvmDemo/kotlin/DemoShapeSDF05.kt) + ![DemoShapeSDF05Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoShapeSDF05Kt.png) +[source code](src/jvmDemo/kotlin/DemoShapeSDF05.kt) + ### DemoSkeleton01 -[source code](src/jvmDemo/kotlin/DemoSkeleton01.kt) + ![DemoSkeleton01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoSkeleton01Kt.png) +[source code](src/jvmDemo/kotlin/DemoSkeleton01.kt) + ### DemoStraightSkeleton01 -[source code](src/jvmDemo/kotlin/DemoStraightSkeleton01.kt) + ![DemoStraightSkeleton01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoStraightSkeleton01Kt.png) +[source code](src/jvmDemo/kotlin/DemoStraightSkeleton01.kt) + ### DemoVoronoi01 -[source code](src/jvmDemo/kotlin/DemoVoronoi01.kt) + ![DemoVoronoi01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoVoronoi01Kt.png) +[source code](src/jvmDemo/kotlin/DemoVoronoi01.kt) + ### DemoVoronoi02 -[source code](src/jvmDemo/kotlin/DemoVoronoi02.kt) + ![DemoVoronoi02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoVoronoi02Kt.png) +[source code](src/jvmDemo/kotlin/DemoVoronoi02.kt) + ### DemoVoronoi03 -[source code](src/jvmDemo/kotlin/DemoVoronoi03.kt) + ![DemoVoronoi03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jumpflood/images/DemoVoronoi03Kt.png) + +[source code](src/jvmDemo/kotlin/DemoVoronoi03.kt) diff --git a/orx-kdtree/README.md b/orx-kdtree/README.md index 9a8281d3..80fdf8d6 100644 --- a/orx-kdtree/README.md +++ b/orx-kdtree/README.md @@ -5,16 +5,50 @@ Fast search of points closest to the queried point in a data set. 2D, 3D and 4D. ## Demos ### DemoKNearestNeighbour01 -[source code](src/jvmDemo/kotlin/DemoKNearestNeighbour01.kt) +This demo initializes an interactive graphical application where 1000 randomly distributed points +are displayed on a 2D canvas. A KD-tree structure is used for spatial querying of the points, enabling +efficient nearest-neighbor searches based on the user's cursor position. The closest 7 points to the +cursor are highlighted with circles and lines connecting them to the cursor. + +Key features: +- Generates 1000 random 2D points within the canvas. +- Builds a KD-tree from the list of points for optimized spatial querying. +- Visualizes the points and highlights the 7 nearest neighbors to the user's cursor position dynamically. +- Highlights include red-colored circles around the nearest points and red lines connecting them to the cursor. ![DemoKNearestNeighbour01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-kdtree/images/DemoKNearestNeighbour01Kt.png) -### DemoNearestNeighbour01 -[source code](src/jvmDemo/kotlin/DemoNearestNeighbour01.kt) +[source code](src/jvmDemo/kotlin/DemoKNearestNeighbour01.kt) +### DemoNearestNeighbour01 + +Initializes an interactive graphical application that displays 1000 randomly distributed 2D points. +The points are organized into a KD-tree for efficient spatial querying. + +Key functionality: +- Displays the points as small circles on the canvas. +- Dynamically highlights the nearest point to the cursor's position by drawing a larger circle around it. + +Highlights: +- KD-tree structure enables efficient nearest-neighbor searches. +- The nearest point to the cursor is determined and visually emphasized in real-time as the cursor moves. ![DemoNearestNeighbour01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-kdtree/images/DemoNearestNeighbour01Kt.png) -### DemoRangeQuery01 -[source code](src/jvmDemo/kotlin/DemoRangeQuery01.kt) +[source code](src/jvmDemo/kotlin/DemoNearestNeighbour01.kt) +### DemoRangeQuery01 + +Initializes an interactive graphical application that demonstrates spatial querying with KD-trees. +A canvas is populated with 1000 randomly distributed 2D points, and a KD-tree is used for efficient +spatial operations. The program dynamically highlights points within a specified radius from the +user's cursor position. + +Key features: +- Generates and displays 1000 random 2D points within the canvas. +- Builds a KD-tree structure for optimized querying of spatial data. +- Dynamically highlights points within a specified radius (50.0) from the cursor position. +- Visualizes the current query radius around the cursor as an outline circle. +- Uses different fill and stroke styles to distinguish highlighted points and query visuals. ![DemoRangeQuery01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-kdtree/images/DemoRangeQuery01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoRangeQuery01.kt) diff --git a/orx-marching-squares/README.md b/orx-marching-squares/README.md index 5c2529b8..f8ad216f 100644 --- a/orx-marching-squares/README.md +++ b/orx-marching-squares/README.md @@ -22,21 +22,29 @@ drawer.contours(contours) ## Demos ### FindContours01 -[source code](src/jvmDemo/kotlin/FindContours01.kt) + ![FindContours01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-marching-squares/images/FindContours01Kt.png) +[source code](src/jvmDemo/kotlin/FindContours01.kt) + ### FindContours02 -[source code](src/jvmDemo/kotlin/FindContours02.kt) + ![FindContours02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-marching-squares/images/FindContours02Kt.png) +[source code](src/jvmDemo/kotlin/FindContours02.kt) + ### FindContours03 -[source code](src/jvmDemo/kotlin/FindContours03.kt) + ![FindContours03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-marching-squares/images/FindContours03Kt.png) +[source code](src/jvmDemo/kotlin/FindContours03.kt) + ### FindContours04 -[source code](src/jvmDemo/kotlin/FindContours04.kt) + ![FindContours04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-marching-squares/images/FindContours04Kt.png) + +[source code](src/jvmDemo/kotlin/FindContours04.kt) diff --git a/orx-math/README.md b/orx-math/README.md index 1251988c..fbf47865 100644 --- a/orx-math/README.md +++ b/orx-math/README.md @@ -4,36 +4,55 @@ Mathematical utilities ## Demos ### linearrange/DemoLinearRange02 -[source code](src/jvmDemo/kotlin/linearrange/DemoLinearRange02.kt) + ![linearrange-DemoLinearRange02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-math/images/linearrange-DemoLinearRange02Kt.png) +[source code](src/jvmDemo/kotlin/linearrange/DemoLinearRange02.kt) + ### linearrange/DemoLinearRange03 -[source code](src/jvmDemo/kotlin/linearrange/DemoLinearRange03.kt) + ![linearrange-DemoLinearRange03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-math/images/linearrange-DemoLinearRange03Kt.png) -### matrix/DemoLeastSquares01 -[source code](src/jvmDemo/kotlin/matrix/DemoLeastSquares01.kt) +[source code](src/jvmDemo/kotlin/linearrange/DemoLinearRange03.kt) +### matrix/DemoLeastSquares01 + +Demonstrate least squares method to find a regression line through noisy points +Line drawn in red is the estimated line, in green is the ground-truth line + +Ax = b => x = A⁻¹b +because A is likely inconsistent, we look for an approximate x based on AᵀA, which is consistent. +x̂ = (AᵀA)⁻¹ Aᵀb ![matrix-DemoLeastSquares01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-math/images/matrix-DemoLeastSquares01Kt.png) -### matrix/DemoLeastSquares02 -[source code](src/jvmDemo/kotlin/matrix/DemoLeastSquares02.kt) +[source code](src/jvmDemo/kotlin/matrix/DemoLeastSquares01.kt) +### matrix/DemoLeastSquares02 + +Demonstrate least squares method to fit a cubic bezier to noisy points ![matrix-DemoLeastSquares02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-math/images/matrix-DemoLeastSquares02Kt.png) +[source code](src/jvmDemo/kotlin/matrix/DemoLeastSquares02.kt) + ### rbf/RbfInterpolation01 -[source code](src/jvmDemo/kotlin/rbf/RbfInterpolation01.kt) + ![rbf-RbfInterpolation01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-math/images/rbf-RbfInterpolation01Kt.png) +[source code](src/jvmDemo/kotlin/rbf/RbfInterpolation01.kt) + ### rbf/RbfInterpolation02 -[source code](src/jvmDemo/kotlin/rbf/RbfInterpolation02.kt) + ![rbf-RbfInterpolation02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-math/images/rbf-RbfInterpolation02Kt.png) +[source code](src/jvmDemo/kotlin/rbf/RbfInterpolation02.kt) + ### simplexrange/DemoSimplexRange3D01 -[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexRange3D01.kt) + ![simplexrange-DemoSimplexRange3D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-math/images/simplexrange-DemoSimplexRange3D01Kt.png) + +[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexRange3D01.kt) diff --git a/orx-mesh-generators/README.md b/orx-mesh-generators/README.md index 9ea4e57b..3c94158d 100644 --- a/orx-mesh-generators/README.md +++ b/orx-mesh-generators/README.md @@ -86,86 +86,128 @@ Check out the [source code](src/commonMain/kotlin) to learn about function argum ## Demos ### decal/DemoDecal01 -[source code](src/jvmDemo/kotlin/decal/DemoDecal01.kt) +Demonstrate decal generator as an object slicer +@see ![decal-DemoDecal01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/decal-DemoDecal01Kt.png) -### decal/DemoDecal02 -[source code](src/jvmDemo/kotlin/decal/DemoDecal02.kt) +[source code](src/jvmDemo/kotlin/decal/DemoDecal01.kt) +### decal/DemoDecal02 + +Demonstrate decal generation and rendering +@see ![decal-DemoDecal02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/decal-DemoDecal02Kt.png) +[source code](src/jvmDemo/kotlin/decal/DemoDecal02.kt) + ### DemoAll -[source code](src/jvmDemo/kotlin/DemoAll.kt) + ![DemoAllKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoAllKt.png) +[source code](src/jvmDemo/kotlin/DemoAll.kt) + ### DemoBox -[source code](src/jvmDemo/kotlin/DemoBox.kt) + ![DemoBoxKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoBoxKt.png) +[source code](src/jvmDemo/kotlin/DemoBox.kt) + ### DemoComplex01 -[source code](src/jvmDemo/kotlin/DemoComplex01.kt) + ![DemoComplex01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoComplex01Kt.png) +[source code](src/jvmDemo/kotlin/DemoComplex01.kt) + ### DemoComplex02 -[source code](src/jvmDemo/kotlin/DemoComplex02.kt) + ![DemoComplex02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoComplex02Kt.png) +[source code](src/jvmDemo/kotlin/DemoComplex02.kt) + ### DemoComplex03 -[source code](src/jvmDemo/kotlin/DemoComplex03.kt) + ![DemoComplex03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoComplex03Kt.png) +[source code](src/jvmDemo/kotlin/DemoComplex03.kt) + ### DemoComplex04 -[source code](src/jvmDemo/kotlin/DemoComplex04.kt) + ![DemoComplex04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoComplex04Kt.png) +[source code](src/jvmDemo/kotlin/DemoComplex04.kt) + ### DemoComplex05 -[source code](src/jvmDemo/kotlin/DemoComplex05.kt) + ![DemoComplex05Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoComplex05Kt.png) +[source code](src/jvmDemo/kotlin/DemoComplex05.kt) + ### DemoComplex06 -[source code](src/jvmDemo/kotlin/DemoComplex06.kt) + +Generates a grid of grids of boxes. +Interactive orbital camera. ![DemoComplex06Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoComplex06Kt.png) +[source code](src/jvmDemo/kotlin/DemoComplex06.kt) + ### DemoExtrude01 -[source code](src/jvmDemo/kotlin/DemoExtrude01.kt) + ![DemoExtrude01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoExtrude01Kt.png) +[source code](src/jvmDemo/kotlin/DemoExtrude01.kt) + ### DemoExtrude02 -[source code](src/jvmDemo/kotlin/DemoExtrude02.kt) + ![DemoExtrude02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoExtrude02Kt.png) +[source code](src/jvmDemo/kotlin/DemoExtrude02.kt) + ### DemoExtrude03 -[source code](src/jvmDemo/kotlin/DemoExtrude03.kt) + ![DemoExtrude03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoExtrude03Kt.png) +[source code](src/jvmDemo/kotlin/DemoExtrude03.kt) + ### DemoExtrude04 -[source code](src/jvmDemo/kotlin/DemoExtrude04.kt) + +Extruded Bézier tubes grown on a morphing Bézier surface. ![DemoExtrude04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoExtrude04Kt.png) +[source code](src/jvmDemo/kotlin/DemoExtrude04.kt) + ### DemoExtrude05 -[source code](src/jvmDemo/kotlin/DemoExtrude05.kt) + +Extruded Bézier tubes grown on a morphing Bézier surface. ![DemoExtrude05Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoExtrude05Kt.png) -### DemoExtrude06 -[source code](src/jvmDemo/kotlin/DemoExtrude06.kt) +[source code](src/jvmDemo/kotlin/DemoExtrude05.kt) +### DemoExtrude06 + +Demo extrudeContourStepsMorphed which allows to create a mesh with a morphing cross-section +based on the t value along a Path3D. In other words, a tube in which the cross-section does not need +to be constant, but can be scaled, rotated and displaced along its curvy axis. ![DemoExtrude06Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoExtrude06Kt.png) +[source code](src/jvmDemo/kotlin/DemoExtrude06.kt) + ### tangents/DemoTangents01 -[source code](src/jvmDemo/kotlin/tangents/DemoTangents01.kt) + ![tangents-DemoTangents01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/tangents-DemoTangents01Kt.png) + +[source code](src/jvmDemo/kotlin/tangents/DemoTangents01.kt) diff --git a/orx-mesh-noise/README.md b/orx-mesh-noise/README.md index f7a21b43..33de68e5 100644 --- a/orx-mesh-noise/README.md +++ b/orx-mesh-noise/README.md @@ -4,21 +4,59 @@ Generate random samples on the surface of a mesh ## Demos ### DemoMeshNoise01 -[source code](src/jvmDemo/kotlin/DemoMeshNoise01.kt) +This demo creates a 3D visualization program using the OPENRNDR framework. +It demonstrates loading an OBJ model, generating uniform points on the surface +of the mesh, and rendering these points as small spheres using a custom shader. + +The following key processes are performed: +- Loading mesh data from an OBJ file. +- Generating a list of uniformly distributed points on the mesh surface. +- Rendering the generated points with small spheres. +- Using an "Orbital" extension for interactive camera control. +- Applying a shader effect to visualize surface normals. + +The application runs with a window size of 720x720 pixels and positions the camera +in front of the scene using the "Orbital" extension. ![DemoMeshNoise01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-noise/images/DemoMeshNoise01Kt.png) -### DemoMeshNoise02 -[source code](src/jvmDemo/kotlin/DemoMeshNoise02.kt) +[source code](src/jvmDemo/kotlin/DemoMeshNoise01.kt) +### DemoMeshNoise02 + +Demonstrate uniform point on mesh generation using hash functions ![DemoMeshNoise02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-noise/images/DemoMeshNoise02Kt.png) -### DemoMeshNoise03 -[source code](src/jvmDemo/kotlin/DemoMeshNoise03.kt) +[source code](src/jvmDemo/kotlin/DemoMeshNoise02.kt) +### DemoMeshNoise03 + +This demo loads a 3D model from an OBJ file, processes the mesh data to estimate normals and tangents, and generates +a set of uniformly distributed pose points. These pose points determine the transformations applied to individual +objects rendered in the viewport. + +It extends the rendering with an orbital camera for navigation and shaders for custom visual +effects. Cylinders represent transformed objects, with their scale animations based on time-dependent +trigonometric functions. ![DemoMeshNoise03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-noise/images/DemoMeshNoise03Kt.png) -### DemoNonUniformMeshNoise01 -[source code](src/jvmDemo/kotlin/DemoNonUniformMeshNoise01.kt) +[source code](src/jvmDemo/kotlin/DemoMeshNoise03.kt) +### DemoNonUniformMeshNoise01 + +The program demonstrates the loading of a 3D model, estimating its normals, +sampling points based on non-uniform distribution, and rendering points as spheres. + +Key functionalities include: +- Loading a 3D model from an OBJ file. +- Estimating per-vertex normals for the mesh. +- Generating and rendering a sphere mesh for sampled points. +- Using a lighting direction vector to bias the point sampling distribution. +- Extending the program with an orbital camera for interactive navigation. +- Applying shading to simulate lighting effects based on vertex normals. + +The rendering of spheres is performed by iterating over the sampled points and isolating each in the transformation matrix. +This setup allows customization for complex rendering pipelines. ![DemoNonUniformMeshNoise01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-noise/images/DemoNonUniformMeshNoise01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoNonUniformMeshNoise01.kt) diff --git a/orx-no-clear/README.md b/orx-no-clear/README.md index 1316acf4..1838d65c 100644 --- a/orx-no-clear/README.md +++ b/orx-no-clear/README.md @@ -54,6 +54,8 @@ NB! any submitted _lambda expression_ must be valid within the `renderTarget` co ## Demos ### DemoNoClear -[source code](src/jvmDemo/kotlin/DemoNoClear.kt) + ![DemoNoClearKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-no-clear/images/DemoNoClearKt.png) + +[source code](src/jvmDemo/kotlin/DemoNoClear.kt) diff --git a/orx-noise/README.md b/orx-noise/README.md index 9d323c12..2ae0a3b8 100644 --- a/orx-noise/README.md +++ b/orx-noise/README.md @@ -188,131 +188,265 @@ val v8 = billow(seed, x, y, z, ::perlinLinear, octaves, lacunarity, gain) ## Demos ### DemoCubicNoise2D01 -[source code](src/jvmDemo/kotlin/DemoCubicNoise2D01.kt) + ![DemoCubicNoise2D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/DemoCubicNoise2D01Kt.png) +[source code](src/jvmDemo/kotlin/DemoCubicNoise2D01.kt) + ### DemoFunctionalComposition01 -[source code](src/jvmDemo/kotlin/DemoFunctionalComposition01.kt) + ![DemoFunctionalComposition01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/DemoFunctionalComposition01Kt.png) +[source code](src/jvmDemo/kotlin/DemoFunctionalComposition01.kt) + ### DemoGradientPerturb2D -[source code](src/jvmDemo/kotlin/DemoGradientPerturb2D.kt) + ![DemoGradientPerturb2DKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/DemoGradientPerturb2DKt.png) +[source code](src/jvmDemo/kotlin/DemoGradientPerturb2D.kt) + ### DemoGradientPerturb3D -[source code](src/jvmDemo/kotlin/DemoGradientPerturb3D.kt) + ![DemoGradientPerturb3DKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/DemoGradientPerturb3DKt.png) +[source code](src/jvmDemo/kotlin/DemoGradientPerturb3D.kt) + ### DemoScatter01 -[source code](src/jvmDemo/kotlin/DemoScatter01.kt) + ![DemoScatter01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/DemoScatter01Kt.png) +[source code](src/jvmDemo/kotlin/DemoScatter01.kt) + ### DemoSimplex01 -[source code](src/jvmDemo/kotlin/DemoSimplex01.kt) + ![DemoSimplex01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/DemoSimplex01Kt.png) -### DemoTriangleNoise01 -[source code](src/jvmDemo/kotlin/DemoTriangleNoise01.kt) +[source code](src/jvmDemo/kotlin/DemoSimplex01.kt) +### DemoTriangleNoise01 + +Demonstrate the generation of uniformly distributed points inside a list of triangles +@see ![DemoTriangleNoise01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/DemoTriangleNoise01Kt.png) +[source code](src/jvmDemo/kotlin/DemoTriangleNoise01.kt) + ### DemoValueNoise2D01 -[source code](src/jvmDemo/kotlin/DemoValueNoise2D01.kt) + ![DemoValueNoise2D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/DemoValueNoise2D01Kt.png) -### glsl/DemoNoisesGLSLGui -[source code](src/jvmDemo/kotlin/glsl/DemoNoisesGLSLGui.kt) +[source code](src/jvmDemo/kotlin/DemoValueNoise2D01.kt) +### glsl/DemoNoisesGLSLGui + +Render existing GLSL noise algorithms side by side. +Use the GUI to explore the effects. ![glsl-DemoNoisesGLSLGuiKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/glsl-DemoNoisesGLSLGuiKt.png) -### glsl/DemoNoisesGLSL -[source code](src/jvmDemo/kotlin/glsl/DemoNoisesGLSL.kt) +[source code](src/jvmDemo/kotlin/glsl/DemoNoisesGLSLGui.kt) +### glsl/DemoNoisesGLSL + +Render existing GLSL noise algorithms side by side. +Re-use the same color buffer for the rendering. +Not all noise properties are used. Explore each noise class +to find out more adjustable properties. +The noise color can be set using a `color` or a `gain` property. ![glsl-DemoNoisesGLSLKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/glsl-DemoNoisesGLSLKt.png) -### glsl/DemoSimplexGLSL -[source code](src/jvmDemo/kotlin/glsl/DemoSimplexGLSL.kt) +[source code](src/jvmDemo/kotlin/glsl/DemoNoisesGLSL.kt) +### glsl/DemoSimplexGLSL + +A sine oscillator with randomized parameters ![glsl-DemoSimplexGLSLKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/glsl-DemoSimplexGLSLKt.png) -### hammersley/DemoHammersley2D01 -[source code](src/jvmDemo/kotlin/hammersley/DemoHammersley2D01.kt) +[source code](src/jvmDemo/kotlin/glsl/DemoSimplexGLSL.kt) +### hammersley/DemoHammersley2D01 + +Demo that visualizes a 2D Hammersley point set. + +The application is configured to run at 720x720 resolution. The program computes +400 2D Hammersley points mapped within the bounds of the application's resolution. +These points are visualized by rendering circles at their respective positions. ![hammersley-DemoHammersley2D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/hammersley-DemoHammersley2D01Kt.png) -### hammersley/DemoHammersley3D01 -[source code](src/jvmDemo/kotlin/hammersley/DemoHammersley3D01.kt) +[source code](src/jvmDemo/kotlin/hammersley/DemoHammersley2D01.kt) +### hammersley/DemoHammersley3D01 + +Demo program rendering a 3D visualization of points distributed using the Hammersley sequence in 3D space. + +The application is set up at a resolution of 720x720 pixels. Within the visual +program, a sphere mesh is created and a set of 1400 points is generated using +the Hammersley sequence. Each point is translated and rendered as a small sphere +in 3D space. This is achieved by mapping the generated points into a scaled domain. + +The rendering utilizes the Orbital extension, enabling an interactive 3D camera +to navigate the scene. The visualization relies on the draw loop for continuous +rendering of the points. ![hammersley-DemoHammersley3D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/hammersley-DemoHammersley3D01Kt.png) -### hammersley/DemoHammersley4D01 -[source code](src/jvmDemo/kotlin/hammersley/DemoHammersley4D01.kt) +[source code](src/jvmDemo/kotlin/hammersley/DemoHammersley3D01.kt) +### hammersley/DemoHammersley4D01 + +Demo that visualizes a 4D Hammersley point set in a 3D space, with colors determined by the 4th dimension. + +The application is configured at a resolution of 720x720 pixels. A sphere mesh is created +using the `sphereMesh` utility, and a total of 10,000 4D points are generated with the +`hammersley4D` sequence. These points are scaled, translated, and rendered as small spheres. +The color of each sphere is modified based on the 4th dimension of its corresponding point by +shifting the hue in HSV color space. + +This program employs the `Orbital` extension, enabling camera interaction for 3D navigation +of the scene. Rendering occurs within the draw loop, providing continuous visualization +of the point distribution. ![hammersley-DemoHammersley4D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/hammersley-DemoHammersley4D01Kt.png) +[source code](src/jvmDemo/kotlin/hammersley/DemoHammersley4D01.kt) + ### hash/DemoCircleHash01 -[source code](src/jvmDemo/kotlin/hash/DemoCircleHash01.kt) + ![hash-DemoCircleHash01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/hash-DemoCircleHash01Kt.png) +[source code](src/jvmDemo/kotlin/hash/DemoCircleHash01.kt) + ### hash/DemoRectangleHash01 -[source code](src/jvmDemo/kotlin/hash/DemoRectangleHash01.kt) + ![hash-DemoRectangleHash01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/hash-DemoRectangleHash01Kt.png) +[source code](src/jvmDemo/kotlin/hash/DemoRectangleHash01.kt) + ### hash/DemoUHash01 -[source code](src/jvmDemo/kotlin/hash/DemoUHash01.kt) + ![hash-DemoUHash01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/hash-DemoUHash01Kt.png) +[source code](src/jvmDemo/kotlin/hash/DemoUHash01.kt) + ### linearrange/DemoLinearRange01 -[source code](src/jvmDemo/kotlin/linearrange/DemoLinearRange01.kt) + ![linearrange-DemoLinearRange01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/linearrange-DemoLinearRange01Kt.png) -### phrases/DemoUHashPhrase01 -[source code](src/jvmDemo/kotlin/phrases/DemoUHashPhrase01.kt) +[source code](src/jvmDemo/kotlin/linearrange/DemoLinearRange01.kt) +### phrases/DemoUHashPhrase01 + +Demonstrate uniform hashing function phrase in a shadestyle ![phrases-DemoUHashPhrase01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/phrases-DemoUHashPhrase01Kt.png) -### rseq/DemoRseq2D01 -[source code](src/jvmDemo/kotlin/rseq/DemoRseq2D01.kt) +[source code](src/jvmDemo/kotlin/phrases/DemoUHashPhrase01.kt) +### rseq/DemoRseq2D01 + +This demo sets up a window with dimensions 720x720 and renders frames +demonstrating 2D quasirandomly distributed points. The points are generated +using the R2 sequence and drawn as circles with a radius of 5.0. ![rseq-DemoRseq2D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/rseq-DemoRseq2D01Kt.png) -### rseq/DemoRseq3D01 -[source code](src/jvmDemo/kotlin/rseq/DemoRseq3D01.kt) +[source code](src/jvmDemo/kotlin/rseq/DemoRseq2D01.kt) +### rseq/DemoRseq3D01 + +This demo renders a 3D visualizationof points distributed using the R3 quasirandom sequence. Each point is +represented as a sphere and positioned in 3D space based on the quasirandom sequence values. + +The visualization setup includes: +- Configuration of application window size to 720x720. +- Usage of an orbital camera for interactive 3D navigation. +- Creation of a reusable sphere mesh with a specified radius. +- Generation of quasirandom points in 3D space using the `rSeq3D` function. +- Transformation and rendering of each point as a sphere using vertex buffers. ![rseq-DemoRseq3D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/rseq-DemoRseq3D01Kt.png) -### rseq/DemoRseq4D01 -[source code](src/jvmDemo/kotlin/rseq/DemoRseq4D01.kt) +[source code](src/jvmDemo/kotlin/rseq/DemoRseq3D01.kt) +### rseq/DemoRseq4D01 + +Demo that presents a 3D visualization of points distributed using a 4D quasirandom sequence (R4). +Each point is represented as a sphere with it position and color derived from the sequence values. + +This function performs the following tasks: +- Configures the application window dimensions to 720x720 pixels. +- Initializes a 3D camera for orbital navigation of the scene. +- Generates 10,000 points in 4D space using the `rSeq4D` function. The points are scaled +and transformed into 3D positions with an additional w-coordinate for color variation. +- Creates a reusable sphere mesh for rendering. +- Renders each point as a sphere with its position determined by the 3D coordinates +of the point and its color calculated by shifting the hue of a base color using +the w-coordinate value. ![rseq-DemoRseq4D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/rseq-DemoRseq4D01Kt.png) -### simplexrange/DemoSimplexRange2D01 -[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexRange2D01.kt) +[source code](src/jvmDemo/kotlin/rseq/DemoRseq4D01.kt) +### simplexrange/DemoSimplexRange2D01 + +This demo creates a dynamic graphical output utilizing simplex and +linear interpolation-based color ranges. + +Functionalities: +- Defines a list of base colors converted to LAB color space for smooth interpolation. +- Constructs a 3D simplex range and a 2D linear range for color sampling. +- Randomly populates two sections of the screen with rectangles filled with colors +sampled from simplex and linear ranges respectively. +- Draws a vertical divider line in the middle of the application window. ![simplexrange-DemoSimplexRange2D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/simplexrange-DemoSimplexRange2D01Kt.png) -### simplexrange/DemoSimplexRange2D02 -[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexRange2D02.kt) +[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexRange2D01.kt) +### simplexrange/DemoSimplexRange2D02 + +This demo creates a dynamic graphical output utilizing simplex and +linear interpolation-based color ranges. + +Functionalities: +- Defines a list of base colors converted to LAB color space for smooth interpolation. +- Constructs a 3D simplex range and a 2D linear range for color sampling. +- Randomly populates two sections of the screen with rectangles filled with colors +sampled from simplex and linear ranges respectively. +- Draws a vertical divider line in the middle of the application window. ![simplexrange-DemoSimplexRange2D02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/simplexrange-DemoSimplexRange2D02Kt.png) -### simplexrange/DemoSimplexUniform01 -[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexUniform01.kt) +[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexRange2D02.kt) +### simplexrange/DemoSimplexUniform01 + +This demo creates a dynamic graphical output utilizing simplex and +linear interpolation-based color ranges. + +Functionalities: +- Defines a list of base colors converted to LAB color space for smooth interpolation. +- Constructs a 3D simplex range and a 2D linear range for color sampling. +- Randomly populates two sections of the screen with rectangles filled with colors +sampled from simplex and linear ranges respectively. +- Draws a vertical divider line in the middle of the application window. ![simplexrange-DemoSimplexUniform01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/simplexrange-DemoSimplexUniform01Kt.png) -### simplexrange/DemoSimplexUniform02 -[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexUniform02.kt) +[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexUniform01.kt) +### simplexrange/DemoSimplexUniform02 + +This demo creates a dynamic graphical output utilizing simplex and +linear interpolation-based color ranges. + +Functionalities: +- Defines a list of base colors converted to LAB color space for smooth interpolation. +- Constructs a 3D simplex range and a 2D linear range for color sampling. +- Randomly populates two sections of the screen with rectangles filled with colors +sampled from simplex and linear ranges respectively. +- Draws a vertical divider line in the middle of the application window. ![simplexrange-DemoSimplexUniform02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/simplexrange-DemoSimplexUniform02Kt.png) + +[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexUniform02.kt) diff --git a/orx-obj-loader/README.md b/orx-obj-loader/README.md index 9c48e045..f5b4df7c 100644 --- a/orx-obj-loader/README.md +++ b/orx-obj-loader/README.md @@ -25,26 +25,36 @@ vertexBuffer.saveOBJ("my/path/exported.obj") ## Demos ### DemoObjCompoundRW01 -[source code](src/jvmDemo/kotlin/DemoObjCompoundRW01.kt) + ![DemoObjCompoundRW01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-obj-loader/images/DemoObjCompoundRW01Kt.png) +[source code](src/jvmDemo/kotlin/DemoObjCompoundRW01.kt) + ### DemoObjLoader01 -[source code](src/jvmDemo/kotlin/DemoObjLoader01.kt) + ![DemoObjLoader01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-obj-loader/images/DemoObjLoader01Kt.png) +[source code](src/jvmDemo/kotlin/DemoObjLoader01.kt) + ### DemoObjSaver01 -[source code](src/jvmDemo/kotlin/DemoObjSaver01.kt) + ![DemoObjSaver01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-obj-loader/images/DemoObjSaver01Kt.png) +[source code](src/jvmDemo/kotlin/DemoObjSaver01.kt) + ### DemoObjSaver02 -[source code](src/jvmDemo/kotlin/DemoObjSaver02.kt) + ![DemoObjSaver02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-obj-loader/images/DemoObjSaver02Kt.png) -### DemoWireframe01 -[source code](src/jvmDemo/kotlin/DemoWireframe01.kt) +[source code](src/jvmDemo/kotlin/DemoObjSaver02.kt) +### DemoWireframe01 + +Display wireframe and non-planar faces ![DemoWireframe01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-obj-loader/images/DemoWireframe01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoWireframe01.kt) diff --git a/orx-property-watchers/README.md b/orx-property-watchers/README.md index cd70c1d0..8e13ac8f 100644 --- a/orx-property-watchers/README.md +++ b/orx-property-watchers/README.md @@ -5,11 +5,15 @@ Tools for setting up property watcher based pipelines ## Demos ### DemoImagePathWatcher01 -[source code](src/jvmDemo/kotlin/DemoImagePathWatcher01.kt) + ![DemoImagePathWatcher01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-property-watchers/images/DemoImagePathWatcher01Kt.png) +[source code](src/jvmDemo/kotlin/DemoImagePathWatcher01.kt) + ### DemoPropertyWatchers01 -[source code](src/jvmDemo/kotlin/DemoPropertyWatchers01.kt) + ![DemoPropertyWatchers01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-property-watchers/images/DemoPropertyWatchers01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoPropertyWatchers01.kt) diff --git a/orx-quadtree/README.md b/orx-quadtree/README.md index 37918071..b6960bdb 100644 --- a/orx-quadtree/README.md +++ b/orx-quadtree/README.md @@ -23,11 +23,15 @@ Ricardo Matias / [@ricardomatias](https://github.com/ricardomatias) ## Demos ### DemoQuadTree01 -[source code](src/jvmDemo/kotlin/DemoQuadTree01.kt) + ![DemoQuadTree01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-quadtree/images/DemoQuadTree01Kt.png) +[source code](src/jvmDemo/kotlin/DemoQuadTree01.kt) + ### DemoQuadTree02 -[source code](src/jvmDemo/kotlin/DemoQuadTree02.kt) + ![DemoQuadTree02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-quadtree/images/DemoQuadTree02Kt.png) + +[source code](src/jvmDemo/kotlin/DemoQuadTree02.kt) diff --git a/orx-shade-styles/README.md b/orx-shade-styles/README.md index e57c6974..b524897b 100644 --- a/orx-shade-styles/README.md +++ b/orx-shade-styles/README.md @@ -9,121 +9,181 @@ Shader based fills and strokes, including various types of gradient fills. ## Demos ### clip/DemoClip01 -[source code](src/jvmDemo/kotlin/clip/DemoClip01.kt) + ![clip-DemoClip01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/clip-DemoClip01Kt.png) +[source code](src/jvmDemo/kotlin/clip/DemoClip01.kt) + ### clip/DemoClip02 -[source code](src/jvmDemo/kotlin/clip/DemoClip02.kt) + ![clip-DemoClip02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/clip-DemoClip02Kt.png) +[source code](src/jvmDemo/kotlin/clip/DemoClip02.kt) + ### clip/DemoClip03 -[source code](src/jvmDemo/kotlin/clip/DemoClip03.kt) + ![clip-DemoClip03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/clip-DemoClip03Kt.png) -### composed/DemoComposed01 -[source code](src/jvmDemo/kotlin/composed/DemoComposed01.kt) +[source code](src/jvmDemo/kotlin/clip/DemoClip03.kt) +### composed/DemoComposed01 + +The main entry point of the application that sets up the visual program. + +This method creates a graphical program with a 720x720 window and uses a rotating +gradient-shaded rectangle as the primary visual element. It demonstrates the use +of gradient shading and clipping through a compositional approach. + +The method performs the following actions: +1. Configures the application window size. +2. Constructs a conic gradient with a rotation of 54 degrees and full circular coverage. +3. Creates a star-shaped clip with configurable sharpness, radius, and number of sides. +4. Combines the gradient and clip into a composite shading style. +5. Defines a program loop where the rectangle with the gradient and clip combination +rotates around the center of the canvas while being redrawn continuously. ![composed-DemoComposed01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/composed-DemoComposed01Kt.png) +[source code](src/jvmDemo/kotlin/composed/DemoComposed01.kt) + ### gradients/DemoGradient01 -[source code](src/jvmDemo/kotlin/gradients/DemoGradient01.kt) + ![gradients-DemoGradient01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/gradients-DemoGradient01Kt.png) +[source code](src/jvmDemo/kotlin/gradients/DemoGradient01.kt) + ### gradients/DemoGradient02 -[source code](src/jvmDemo/kotlin/gradients/DemoGradient02.kt) + ![gradients-DemoGradient02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/gradients-DemoGradient02Kt.png) +[source code](src/jvmDemo/kotlin/gradients/DemoGradient02.kt) + ### gradients/DemoGradient03 -[source code](src/jvmDemo/kotlin/gradients/DemoGradient03.kt) + ![gradients-DemoGradient03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/gradients-DemoGradient03Kt.png) +[source code](src/jvmDemo/kotlin/gradients/DemoGradient03.kt) + ### gradients/DemoGradient04 -[source code](src/jvmDemo/kotlin/gradients/DemoGradient04.kt) + ![gradients-DemoGradient04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/gradients-DemoGradient04Kt.png) +[source code](src/jvmDemo/kotlin/gradients/DemoGradient04.kt) + ### gradients/DemoGradient05 -[source code](src/jvmDemo/kotlin/gradients/DemoGradient05.kt) + ![gradients-DemoGradient05Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/gradients-DemoGradient05Kt.png) +[source code](src/jvmDemo/kotlin/gradients/DemoGradient05.kt) + ### gradients/DemoGradient06 -[source code](src/jvmDemo/kotlin/gradients/DemoGradient06.kt) + ![gradients-DemoGradient06Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/gradients-DemoGradient06Kt.png) +[source code](src/jvmDemo/kotlin/gradients/DemoGradient06.kt) + ### gradients/DemoGradient07 -[source code](src/jvmDemo/kotlin/gradients/DemoGradient07.kt) + ![gradients-DemoGradient07Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/gradients-DemoGradient07Kt.png) +[source code](src/jvmDemo/kotlin/gradients/DemoGradient07.kt) + ### gradients/DemoGradient08 -[source code](src/jvmDemo/kotlin/gradients/DemoGradient08.kt) + ![gradients-DemoGradient08Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/gradients-DemoGradient08Kt.png) +[source code](src/jvmDemo/kotlin/gradients/DemoGradient08.kt) + ### gradients/DemoGradient09 -[source code](src/jvmDemo/kotlin/gradients/DemoGradient09.kt) + ![gradients-DemoGradient09Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/gradients-DemoGradient09Kt.png) +[source code](src/jvmDemo/kotlin/gradients/DemoGradient09.kt) + ### image/DemoImageFill01 -[source code](src/jvmDemo/kotlin/image/DemoImageFill01.kt) + ![image-DemoImageFill01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/image-DemoImageFill01Kt.png) +[source code](src/jvmDemo/kotlin/image/DemoImageFill01.kt) + ### image/DemoImageFill02 -[source code](src/jvmDemo/kotlin/image/DemoImageFill02.kt) + ![image-DemoImageFill02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/image-DemoImageFill02Kt.png) +[source code](src/jvmDemo/kotlin/image/DemoImageFill02.kt) + ### image/DemoImageFill03 -[source code](src/jvmDemo/kotlin/image/DemoImageFill03.kt) + ![image-DemoImageFill03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/image-DemoImageFill03Kt.png) +[source code](src/jvmDemo/kotlin/image/DemoImageFill03.kt) + ### noise/DemoBlueNoise01 -[source code](src/jvmDemo/kotlin/noise/DemoBlueNoise01.kt) + ![noise-DemoBlueNoise01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/noise-DemoBlueNoise01Kt.png) +[source code](src/jvmDemo/kotlin/noise/DemoBlueNoise01.kt) + ### noise/DemoSimplex01 -[source code](src/jvmDemo/kotlin/noise/DemoSimplex01.kt) + ![noise-DemoSimplex01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/noise-DemoSimplex01Kt.png) +[source code](src/jvmDemo/kotlin/noise/DemoSimplex01.kt) + ### noise/DemoWhiteNoise01 -[source code](src/jvmDemo/kotlin/noise/DemoWhiteNoise01.kt) + ![noise-DemoWhiteNoise01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/noise-DemoWhiteNoise01Kt.png) +[source code](src/jvmDemo/kotlin/noise/DemoWhiteNoise01.kt) + ### patterns/DemoPatterns01 -[source code](src/jvmDemo/kotlin/patterns/DemoPatterns01.kt) + ![patterns-DemoPatterns01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/patterns-DemoPatterns01Kt.png) +[source code](src/jvmDemo/kotlin/patterns/DemoPatterns01.kt) + ### patterns/DemoPatterns02 -[source code](src/jvmDemo/kotlin/patterns/DemoPatterns02.kt) + ![patterns-DemoPatterns02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/patterns-DemoPatterns02Kt.png) +[source code](src/jvmDemo/kotlin/patterns/DemoPatterns02.kt) + ### patterns/DemoPatterns03 -[source code](src/jvmDemo/kotlin/patterns/DemoPatterns03.kt) + ![patterns-DemoPatterns03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/patterns-DemoPatterns03Kt.png) +[source code](src/jvmDemo/kotlin/patterns/DemoPatterns03.kt) + ### spatial/DemoHemisphere01 -[source code](src/jvmDemo/kotlin/spatial/DemoHemisphere01.kt) + ![spatial-DemoHemisphere01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/spatial-DemoHemisphere01Kt.png) +[source code](src/jvmDemo/kotlin/spatial/DemoHemisphere01.kt) + ### spatial/DemoVisualizeNormals01 -[source code](src/jvmDemo/kotlin/spatial/DemoVisualizeNormals01.kt) + ![spatial-DemoVisualizeNormals01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/spatial-DemoVisualizeNormals01Kt.png) + +[source code](src/jvmDemo/kotlin/spatial/DemoVisualizeNormals01.kt) diff --git a/orx-shapes/README.md b/orx-shapes/README.md index df9f5bb6..913b6b92 100644 --- a/orx-shapes/README.md +++ b/orx-shapes/README.md @@ -5,316 +5,495 @@ Collection of 2D shape generators and modifiers. ## Demos ### adjust/DemoAdjustContour01 -[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour01.kt) + ![adjust-DemoAdjustContour01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/adjust-DemoAdjustContour01Kt.png) +[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour01.kt) + ### adjust/DemoAdjustContour02 -[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour02.kt) + ![adjust-DemoAdjustContour02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/adjust-DemoAdjustContour02Kt.png) +[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour02.kt) + ### adjust/DemoAdjustContour03 -[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour03.kt) + ![adjust-DemoAdjustContour03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/adjust-DemoAdjustContour03Kt.png) +[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour03.kt) + ### adjust/DemoAdjustContour04 -[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour04.kt) + ![adjust-DemoAdjustContour04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/adjust-DemoAdjustContour04Kt.png) +[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour04.kt) + ### adjust/DemoAdjustContour05 -[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour05.kt) + ![adjust-DemoAdjustContour05Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/adjust-DemoAdjustContour05Kt.png) +[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour05.kt) + ### adjust/DemoAdjustContour06 -[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour06.kt) + ![adjust-DemoAdjustContour06Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/adjust-DemoAdjustContour06Kt.png) +[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour06.kt) + ### adjust/DemoAdjustContour07 -[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour07.kt) + ![adjust-DemoAdjustContour07Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/adjust-DemoAdjustContour07Kt.png) +[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour07.kt) + ### adjust/DemoAdjustContour08 -[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour08.kt) + ![adjust-DemoAdjustContour08Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/adjust-DemoAdjustContour08Kt.png) +[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour08.kt) + ### adjust/DemoAdjustContour09 -[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour09.kt) + ![adjust-DemoAdjustContour09Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/adjust-DemoAdjustContour09Kt.png) +[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour09.kt) + ### adjust/DemoAdjustContourContinue01 -[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContourContinue01.kt) + ![adjust-DemoAdjustContourContinue01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/adjust-DemoAdjustContourContinue01Kt.png) +[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContourContinue01.kt) + ### alphashape/DemoAlphaShape -[source code](src/jvmDemo/kotlin/alphashape/DemoAlphaShape.kt) + ![alphashape-DemoAlphaShapeKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/alphashape-DemoAlphaShapeKt.png) +[source code](src/jvmDemo/kotlin/alphashape/DemoAlphaShape.kt) + ### arrangement/DemoArrangement01 -[source code](src/jvmDemo/kotlin/arrangement/DemoArrangement01.kt) + ![arrangement-DemoArrangement01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/arrangement-DemoArrangement01Kt.png) +[source code](src/jvmDemo/kotlin/arrangement/DemoArrangement01.kt) + ### arrangement/DemoArrangement02 -[source code](src/jvmDemo/kotlin/arrangement/DemoArrangement02.kt) + ![arrangement-DemoArrangement02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/arrangement-DemoArrangement02Kt.png) +[source code](src/jvmDemo/kotlin/arrangement/DemoArrangement02.kt) + ### arrangement/DemoArrangement04 -[source code](src/jvmDemo/kotlin/arrangement/DemoArrangement04.kt) + ![arrangement-DemoArrangement04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/arrangement-DemoArrangement04Kt.png) -### bezierpatch/DemoBezierPatch01 -[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch01.kt) +[source code](src/jvmDemo/kotlin/arrangement/DemoArrangement04.kt) +### bezierpatch/DemoBezierPatch01 + +Shows how to +- create a [bezierPatch] out of 4 [LineSegment] +- create a sub-patch out of a [bezierPatch] +- create horizontal and vertical [ShapeContour]s out of [bezierPatch]es + +The created contours are horizontal and vertical in "bezier-patch space" but +are rendered deformed following the shape of the bezier patch. ![bezierpatch-DemoBezierPatch01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/bezierpatch-DemoBezierPatch01Kt.png) -### bezierpatch/DemoBezierPatch02 -[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch02.kt) +[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch01.kt) +### bezierpatch/DemoBezierPatch02 + +Shows how to create a [bezierPatch] out of a +closed [ShapeContour] with 4 curved segments. + +Calling [Circle.contour] is one way of producing +such a contour with vertices at the cardinal points +but one can manually create any other 4-segment closed contour +to use in bezier patches. ![bezierpatch-DemoBezierPatch02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/bezierpatch-DemoBezierPatch02Kt.png) -### bezierpatch/DemoBezierPatch03 -[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch03.kt) +[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch02.kt) +### bezierpatch/DemoBezierPatch03 + +Shows how to distort [ShapeContour]s using a [bezierPatch] + +In this case the contours are regular stars and the bezier patch +is created using a circular contour with the required 4 segments. ![bezierpatch-DemoBezierPatch03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/bezierpatch-DemoBezierPatch03Kt.png) -### bezierpatch/DemoBezierPatch04 -[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch04.kt) +[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch03.kt) +### bezierpatch/DemoBezierPatch04 + +Shows how to get positions and gradient values of those positions +from a [bezierPatch] + +You can think of bezierPatch.position() as requesting points +in a wavy flag (the bezier patch) using normalized uv coordinates. ![bezierpatch-DemoBezierPatch04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/bezierpatch-DemoBezierPatch04Kt.png) -### bezierpatch/DemoBezierPatch05 -[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch05.kt) +[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch04.kt) +### bezierpatch/DemoBezierPatch05 + +Shows how to +- create a [bezierPatch] out of 4 [Segment3D] +- create a sub-patch out of a [bezierPatch] +- create horizontal and vertical [Path3D]s out of [bezierPatch]es +- add colors to a [bezierPatch] +- draw a [bezierPatch] surface + +The created contours are horizontal and vertical in "bezier-patch space" but +are rendered deformed following the shape of the bezier patch. ![bezierpatch-DemoBezierPatch05Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/bezierpatch-DemoBezierPatch05Kt.png) +[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch05.kt) + ### bezierpatch/DemoBezierPatch06 -[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch06.kt) + +Shows how to +- create a [bezierPatch] out of 4 curved Segment2D instances +- apply an image texture to the patch using a shadeStyle ![bezierpatch-DemoBezierPatch06Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/bezierpatch-DemoBezierPatch06Kt.png) +[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch06.kt) + ### bezierpatch/DemoBezierPatchDrawer01 -[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer01.kt) + ![bezierpatch-DemoBezierPatchDrawer01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/bezierpatch-DemoBezierPatchDrawer01Kt.png) +[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer01.kt) + ### bezierpatch/DemoBezierPatchDrawer02 -[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer02.kt) + ![bezierpatch-DemoBezierPatchDrawer02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/bezierpatch-DemoBezierPatchDrawer02Kt.png) +[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer02.kt) + ### bezierpatch/DemoBezierPatchDrawer03 -[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer03.kt) + ![bezierpatch-DemoBezierPatchDrawer03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/bezierpatch-DemoBezierPatchDrawer03Kt.png) -### bezierpatch/DemoBezierPatches01 -[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatches01.kt) +[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer03.kt) +### bezierpatch/DemoBezierPatches01 + +Shows how to create a [bezierPatch] out of a +closed [ShapeContour] with 4 curved segments. + +Calling [Circle.contour] is one way of producing +such a contour with vertices at the cardinal points +but one can manually create any other 4-segment closed contour +to use in bezier patches. ![bezierpatch-DemoBezierPatches01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/bezierpatch-DemoBezierPatches01Kt.png) -### blend/DemoContourBlend01 -[source code](src/jvmDemo/kotlin/blend/DemoContourBlend01.kt) +[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatches01.kt) +### blend/DemoContourBlend01 + +Demonstration of uniform contour blending ![blend-DemoContourBlend01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/blend-DemoContourBlend01Kt.png) -### blend/DemoContourBlend02 -[source code](src/jvmDemo/kotlin/blend/DemoContourBlend02.kt) +[source code](src/jvmDemo/kotlin/blend/DemoContourBlend01.kt) +### blend/DemoContourBlend02 + +Demonstration of non-uniform contour blending ![blend-DemoContourBlend02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/blend-DemoContourBlend02Kt.png) +[source code](src/jvmDemo/kotlin/blend/DemoContourBlend02.kt) + ### frames/DemoFrames01 -[source code](src/jvmDemo/kotlin/frames/DemoFrames01.kt) + ![frames-DemoFrames01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/frames-DemoFrames01Kt.png) +[source code](src/jvmDemo/kotlin/frames/DemoFrames01.kt) + ### hobbycurve/DemoHobbyCurve01 -[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve01.kt) + ![hobbycurve-DemoHobbyCurve01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/hobbycurve-DemoHobbyCurve01Kt.png) +[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve01.kt) + ### hobbycurve/DemoHobbyCurve02 -[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve02.kt) + ![hobbycurve-DemoHobbyCurve02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/hobbycurve-DemoHobbyCurve02Kt.png) +[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve02.kt) + ### hobbycurve/DemoHobbyCurve03 -[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve03.kt) + ![hobbycurve-DemoHobbyCurve03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/hobbycurve-DemoHobbyCurve03Kt.png) +[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve03.kt) + ### hobbycurve/DemoHobbyCurve3D01 -[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve3D01.kt) + ![hobbycurve-DemoHobbyCurve3D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/hobbycurve-DemoHobbyCurve3D01Kt.png) +[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve3D01.kt) + ### operators/DemoRoundCorners01 -[source code](src/jvmDemo/kotlin/operators/DemoRoundCorners01.kt) + ![operators-DemoRoundCorners01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/operators-DemoRoundCorners01Kt.png) +[source code](src/jvmDemo/kotlin/operators/DemoRoundCorners01.kt) + ### ordering/DemoHilbertOrder01 -[source code](src/jvmDemo/kotlin/ordering/DemoHilbertOrder01.kt) + ![ordering-DemoHilbertOrder01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/ordering-DemoHilbertOrder01Kt.png) +[source code](src/jvmDemo/kotlin/ordering/DemoHilbertOrder01.kt) + ### ordering/DemoHilbertOrder02 -[source code](src/jvmDemo/kotlin/ordering/DemoHilbertOrder02.kt) + ![ordering-DemoHilbertOrder02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/ordering-DemoHilbertOrder02Kt.png) +[source code](src/jvmDemo/kotlin/ordering/DemoHilbertOrder02.kt) + ### path3d/DemoPath3DProjection -[source code](src/jvmDemo/kotlin/path3d/DemoPath3DProjection.kt) + ![path3d-DemoPath3DProjectionKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/path3d-DemoPath3DProjectionKt.png) +[source code](src/jvmDemo/kotlin/path3d/DemoPath3DProjection.kt) + ### primitives/DemoArc01 -[source code](src/jvmDemo/kotlin/primitives/DemoArc01.kt) + ![primitives-DemoArc01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoArc01Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoArc01.kt) + ### primitives/DemoCircleInversion01 -[source code](src/jvmDemo/kotlin/primitives/DemoCircleInversion01.kt) + ![primitives-DemoCircleInversion01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoCircleInversion01Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoCircleInversion01.kt) + ### primitives/DemoCircleInversion02 -[source code](src/jvmDemo/kotlin/primitives/DemoCircleInversion02.kt) + ![primitives-DemoCircleInversion02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoCircleInversion02Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoCircleInversion02.kt) + ### primitives/DemoCircleInversion03 -[source code](src/jvmDemo/kotlin/primitives/DemoCircleInversion03.kt) + ![primitives-DemoCircleInversion03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoCircleInversion03Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoCircleInversion03.kt) + ### primitives/DemoNet01 -[source code](src/jvmDemo/kotlin/primitives/DemoNet01.kt) + ![primitives-DemoNet01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoNet01Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoNet01.kt) + ### primitives/DemoPulley01 -[source code](src/jvmDemo/kotlin/primitives/DemoPulley01.kt) + ![primitives-DemoPulley01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoPulley01Kt.png) -### primitives/DemoRectangleDistribute01 -[source code](src/jvmDemo/kotlin/primitives/DemoRectangleDistribute01.kt) +[source code](src/jvmDemo/kotlin/primitives/DemoPulley01.kt) +### primitives/DemoRectangleDistribute01 + +of rectangles, which are generated and manipulated based on time and random parameters. The application +follows these steps: + +1. Initializes a random generator seeded with the elapsed seconds since the start of the program. +2. Creates a sequence of rectangles using the `uniformSub` function to generate random sub-rectangles +within the bounding rectangle of the canvas. +3. Distributes the generated rectangles horizontally within the canvas using the `distributeHorizontally` method. +4. Aligns the rectangles vertically according to their position in relation to the bounding rectangle +and a dynamic anchor point derived from the cosine of elapsed time. +5. Renders the rectangles on the canvas in the output window. ![primitives-DemoRectangleDistribute01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRectangleDistribute01Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoRectangleDistribute01.kt) + ### primitives/DemoRectangleFitHorizontally -[source code](src/jvmDemo/kotlin/primitives/DemoRectangleFitHorizontally.kt) + ![primitives-DemoRectangleFitHorizontallyKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRectangleFitHorizontallyKt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoRectangleFitHorizontally.kt) + ### primitives/DemoRectangleGrid01 -[source code](src/jvmDemo/kotlin/primitives/DemoRectangleGrid01.kt) + ![primitives-DemoRectangleGrid01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRectangleGrid01Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoRectangleGrid01.kt) + ### primitives/DemoRectangleGrid02 -[source code](src/jvmDemo/kotlin/primitives/DemoRectangleGrid02.kt) + ![primitives-DemoRectangleGrid02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRectangleGrid02Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoRectangleGrid02.kt) + ### primitives/DemoRectangleGrid03 -[source code](src/jvmDemo/kotlin/primitives/DemoRectangleGrid03.kt) + ![primitives-DemoRectangleGrid03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRectangleGrid03Kt.png) -### primitives/DemoRectangleIntersection01 -[source code](src/jvmDemo/kotlin/primitives/DemoRectangleIntersection01.kt) +[source code](src/jvmDemo/kotlin/primitives/DemoRectangleGrid03.kt) +### primitives/DemoRectangleIntersection01 + +Demonstrate rectangle-rectangle intersection +@see ![primitives-DemoRectangleIntersection01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRectangleIntersection01Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoRectangleIntersection01.kt) + ### primitives/DemoRectangleIrregularGrid -[source code](src/jvmDemo/kotlin/primitives/DemoRectangleIrregularGrid.kt) + ![primitives-DemoRectangleIrregularGridKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRectangleIrregularGridKt.png) -### primitives/DemoRectanglePlace01 -[source code](src/jvmDemo/kotlin/primitives/DemoRectanglePlace01.kt) +[source code](src/jvmDemo/kotlin/primitives/DemoRectangleIrregularGrid.kt) +### primitives/DemoRectanglePlace01 + +Demo for rendering a 10x10 grid of rectangles within the bounds +of the canvas. Each rectangle's position is calculated relative to its anchors, filling the entire +canvas with evenly placed items. + +The rectangles are drawn using the default white color. The `place` function is applied to each +rectangle to position them dynamically based on their relative anchor points within the bounding area. + +This serves as a demonstration of positioning and rendering shapes in a structured grid layout. ![primitives-DemoRectanglePlace01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRectanglePlace01Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoRectanglePlace01.kt) + ### primitives/DemoRegularPolygon -[source code](src/jvmDemo/kotlin/primitives/DemoRegularPolygon.kt) + ![primitives-DemoRegularPolygonKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRegularPolygonKt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoRegularPolygon.kt) + ### primitives/DemoRegularStar01 -[source code](src/jvmDemo/kotlin/primitives/DemoRegularStar01.kt) + ![primitives-DemoRegularStar01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRegularStar01Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoRegularStar01.kt) + ### primitives/DemoRegularStar02 -[source code](src/jvmDemo/kotlin/primitives/DemoRegularStar02.kt) + ![primitives-DemoRegularStar02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRegularStar02Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoRegularStar02.kt) + ### primitives/DemoRoundedRectangle -[source code](src/jvmDemo/kotlin/primitives/DemoRoundedRectangle.kt) + ![primitives-DemoRoundedRectangleKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRoundedRectangleKt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoRoundedRectangle.kt) + ### primitives/DemoSplit01 -[source code](src/jvmDemo/kotlin/primitives/DemoSplit01.kt) + ![primitives-DemoSplit01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoSplit01Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoSplit01.kt) + ### primitives/DemoTear01 -[source code](src/jvmDemo/kotlin/primitives/DemoTear01.kt) + ![primitives-DemoTear01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoTear01Kt.png) +[source code](src/jvmDemo/kotlin/primitives/DemoTear01.kt) + ### rectify/DemoRectifiedContour01 -[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour01.kt) + ![rectify-DemoRectifiedContour01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/rectify-DemoRectifiedContour01Kt.png) +[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour01.kt) + ### rectify/DemoRectifiedContour02 -[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour02.kt) + ![rectify-DemoRectifiedContour02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/rectify-DemoRectifiedContour02Kt.png) +[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour02.kt) + ### rectify/DemoRectifiedContour03 -[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour03.kt) + ![rectify-DemoRectifiedContour03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/rectify-DemoRectifiedContour03Kt.png) +[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour03.kt) + ### rectify/DemoRectifiedContour04 -[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour04.kt) + ![rectify-DemoRectifiedContour04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/rectify-DemoRectifiedContour04Kt.png) +[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour04.kt) + ### rectify/DemoRectifiedPath3D01 -[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedPath3D01.kt) + ![rectify-DemoRectifiedPath3D01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/rectify-DemoRectifiedPath3D01Kt.png) +[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedPath3D01.kt) + ### text/DemoText01 -[source code](src/jvmDemo/kotlin/text/DemoText01.kt) + ![text-DemoText01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/text-DemoText01Kt.png) +[source code](src/jvmDemo/kotlin/text/DemoText01.kt) + ### tunni/DemoTunniAdjuster01 -[source code](src/jvmDemo/kotlin/tunni/DemoTunniAdjuster01.kt) + ![tunni-DemoTunniAdjuster01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/tunni-DemoTunniAdjuster01Kt.png) +[source code](src/jvmDemo/kotlin/tunni/DemoTunniAdjuster01.kt) + ### tunni/DemoTunniPoint01 -[source code](src/jvmDemo/kotlin/tunni/DemoTunniPoint01.kt) + ![tunni-DemoTunniPoint01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/tunni-DemoTunniPoint01Kt.png) + +[source code](src/jvmDemo/kotlin/tunni/DemoTunniPoint01.kt) diff --git a/orx-temporal-blur/README.md b/orx-temporal-blur/README.md index ecc940cf..9ef29135 100644 --- a/orx-temporal-blur/README.md +++ b/orx-temporal-blur/README.md @@ -42,11 +42,15 @@ extend(TemporalBlur()) { ## Demos ### DemoBasic01 -[source code](src/demo/kotlin/DemoBasic01.kt) + ![DemoBasic01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-temporal-blur/images/DemoBasic01Kt.png) +[source code](src/demo/kotlin/DemoBasic01.kt) + ### DemoColorShift01 -[source code](src/demo/kotlin/DemoColorShift01.kt) + ![DemoColorShift01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-temporal-blur/images/DemoColorShift01Kt.png) + +[source code](src/demo/kotlin/DemoColorShift01.kt) diff --git a/orx-text-on-contour/README.md b/orx-text-on-contour/README.md index 3cec1805..1eb97a93 100644 --- a/orx-text-on-contour/README.md +++ b/orx-text-on-contour/README.md @@ -5,6 +5,12 @@ Writing texts on contours. ## Demos ### DemoTextOnContour01 -[source code](src/jvmDemo/kotlin/DemoTextOnContour01.kt) +Demo Functionality includes: +- Loading and applying a specific font (`IBMPlexMono-Regular`) with a size of 32.0. +- Creating a circular contour at the center of the screen with a radius of 200.0. +- Rendering text along the rectified circle's contour. +- Offsetting text positions, enabling repeated text rendering along the same contour. ![DemoTextOnContour01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-text-on-contour/images/DemoTextOnContour01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoTextOnContour01.kt) diff --git a/orx-text-writer/README.md b/orx-text-writer/README.md index 2027b840..54d7dafa 100644 --- a/orx-text-writer/README.md +++ b/orx-text-writer/README.md @@ -9,16 +9,37 @@ _The code in `orx-text-writer` was previously found under `openrndr-draw` in the ## Demos ### DemoTextWriter01 -[source code](src/jvmDemo/kotlin/DemoTextWriter01.kt) +This demo features the drawing of a centered rectangle and the addition of styled text inside +the rectangle. The application manages the drawing of shapes and implementation of text rendering +with specific font and settings. + +The following operations are performed: +- A rectangle is created from the center of the drawing bounds. +- The rectangle is drawn without a fill and with a white stroke. +- A custom font is loaded and applied to the drawer. +- A `TextWriter` is utilized to display the text "hello world" inside the rectangle, adhering to +specific styling and formatting rules. + +Key Components: +- `application` establishes the visual environment. +- `Rectangle` provides a way to define the rectangular area. +- `drawer` enables isolated operations for drawing elements. +- `writer` facilitates text rendering with alignment and spacing adjustments. ![DemoTextWriter01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-text-writer/images/DemoTextWriter01Kt.png) +[source code](src/jvmDemo/kotlin/DemoTextWriter01.kt) + ### DemoTextWriter02 -[source code](src/jvmDemo/kotlin/DemoTextWriter02.kt) + ![DemoTextWriter02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-text-writer/images/DemoTextWriter02Kt.png) +[source code](src/jvmDemo/kotlin/DemoTextWriter02.kt) + ### DemoTextWriter03 -[source code](src/jvmDemo/kotlin/DemoTextWriter03.kt) + ![DemoTextWriter03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-text-writer/images/DemoTextWriter03Kt.png) + +[source code](src/jvmDemo/kotlin/DemoTextWriter03.kt) diff --git a/orx-time-operators/README.md b/orx-time-operators/README.md index 70c65afe..0eafb2ff 100644 --- a/orx-time-operators/README.md +++ b/orx-time-operators/README.md @@ -56,11 +56,15 @@ drawer.circle(0.0, 0.0, size.sine(freq, phase)) ## Demos ### DemoEnvelope -[source code](src/demo/kotlin/DemoEnvelope.kt) + ![DemoEnvelopeKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-time-operators/images/DemoEnvelopeKt.png) +[source code](src/demo/kotlin/DemoEnvelope.kt) + ### DemoLFO -[source code](src/demo/kotlin/DemoLFO.kt) + ![DemoLFOKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-time-operators/images/DemoLFOKt.png) + +[source code](src/demo/kotlin/DemoLFO.kt) diff --git a/orx-timer/README.md b/orx-timer/README.md index e3227fd7..fc0d98e0 100644 --- a/orx-timer/README.md +++ b/orx-timer/README.md @@ -36,16 +36,22 @@ Note that drawing inside the `repeat` action has no effect. Have a look at the d ## Demos ### DemoRepeat01 -[source code](src/demo/kotlin/DemoRepeat01.kt) + ![DemoRepeat01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-timer/images/DemoRepeat01Kt.png) -### DemoRepeat02 -[source code](src/demo/kotlin/DemoRepeat02.kt) +[source code](src/demo/kotlin/DemoRepeat01.kt) +### DemoRepeat02 + +This demonstrates how to combine `repeat {}` with a postponed event to trigger drawing ![DemoRepeat02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-timer/images/DemoRepeat02Kt.png) +[source code](src/demo/kotlin/DemoRepeat02.kt) + ### DemoTimeOut01 -[source code](src/demo/kotlin/DemoTimeOut01.kt) + ![DemoTimeOut01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-timer/images/DemoTimeOut01Kt.png) + +[source code](src/demo/kotlin/DemoTimeOut01.kt) diff --git a/orx-triangulation/README.md b/orx-triangulation/README.md index 76748623..00af15b1 100644 --- a/orx-triangulation/README.md +++ b/orx-triangulation/README.md @@ -65,26 +65,58 @@ Edwin Jakobs / [@edwinRNDR](https://github.com/edwinRNDR) ## Demos ### DemoDelaunay01 -[source code](src/jvmDemo/kotlin/DemoDelaunay01.kt) +This method sets up a graphical application using the OPENRNDR framework +to visually demonstrate Delaunay triangulation on a set of points scattered +along a circle with Poisson disk sampling. + +The application features the following: +- A central circle with a defined radius. +- Points generated within the circle using a scatter algorithm that +maintains specific spacing and avoids clustering. +- Delaunay triangulation computed from the combined point set. +- Rendering of triangles that are part of the Delaunay triangulation. +- Visual styling with dynamic color shading for better clarity of layers +and triangle order. + +This method demonstrates concepts of computational geometry and procedural +rendering. ![DemoDelaunay01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-triangulation/images/DemoDelaunay01Kt.png) +[source code](src/jvmDemo/kotlin/DemoDelaunay01.kt) + ### DemoDelaunay02 -[source code](src/jvmDemo/kotlin/DemoDelaunay02.kt) + ![DemoDelaunay02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-triangulation/images/DemoDelaunay02Kt.png) -### DemoVoronoi01 -[source code](src/jvmDemo/kotlin/DemoVoronoi01.kt) +[source code](src/jvmDemo/kotlin/DemoDelaunay02.kt) +### DemoVoronoi01 + +This program generates a Voronoi diagram within a defined circular area and visualizes it. + +The program performs the following: +- Defines a circular area and a rectangular bounding frame within the canvas. +- Uses Poisson Disk Sampling to generate points within the circular area. +- Computes the Delaunay triangulation for the generated points, including equidistant points on the circle boundary. +- Derives the Voronoi diagram using the Delaunay triangulation and the bounding frame. +- Extracts the cell polygons of the Voronoi diagram. +- Renders the Voronoi cell polygons on the canvas, with a pink stroke on a black background. ![DemoVoronoi01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-triangulation/images/DemoVoronoi01Kt.png) +[source code](src/jvmDemo/kotlin/DemoVoronoi01.kt) + ### DemoVoronoi02 -[source code](src/jvmDemo/kotlin/DemoVoronoi02.kt) + ![DemoVoronoi02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-triangulation/images/DemoVoronoi02Kt.png) +[source code](src/jvmDemo/kotlin/DemoVoronoi02.kt) + ### DemoVoronoi03 -[source code](src/jvmDemo/kotlin/DemoVoronoi03.kt) + ![DemoVoronoi03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-triangulation/images/DemoVoronoi03Kt.png) + +[source code](src/jvmDemo/kotlin/DemoVoronoi03.kt) diff --git a/orx-turtle/README.md b/orx-turtle/README.md index 4b08acba..eb98f1f9 100644 --- a/orx-turtle/README.md +++ b/orx-turtle/README.md @@ -34,16 +34,25 @@ The language also holds some tools to manage the position and orientation of the ## Demos ### DemoTurtle01 -[source code](src/jvmDemo/kotlin/DemoTurtle01.kt) +/* +Drawing a square using the turtle interface. ![DemoTurtle01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-turtle/images/DemoTurtle01Kt.png) -### DemoTurtle02 -[source code](src/jvmDemo/kotlin/DemoTurtle02.kt) +[source code](src/jvmDemo/kotlin/DemoTurtle01.kt) +### DemoTurtle02 + +/* +A simple random walk made using the turtle interface. ![DemoTurtle02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-turtle/images/DemoTurtle02Kt.png) -### DemoTurtle03 -[source code](src/jvmDemo/kotlin/DemoTurtle03.kt) +[source code](src/jvmDemo/kotlin/DemoTurtle02.kt) +### DemoTurtle03 + +/* +Drawing shape contours aligned to the turtle's orientation. ![DemoTurtle03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-turtle/images/DemoTurtle03Kt.png) + +[source code](src/jvmDemo/kotlin/DemoTurtle03.kt) diff --git a/orx-view-box/README.md b/orx-view-box/README.md index 24418770..3aaa0940 100644 --- a/orx-view-box/README.md +++ b/orx-view-box/README.md @@ -5,21 +5,55 @@ To create independent views inside one program window. ## Demos ### DemoProxyProgram01 -[source code](src/jvmDemo/kotlin/DemoProxyProgram01.kt) +Demonstrates how to use a proxy program inside a [viewBox], +how the main program can access its variables and methods, +and execute its `extend` block by calling its `draw()` method. ![DemoProxyProgram01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-view-box/images/DemoProxyProgram01Kt.png) -### DemoProxyProgram02 -[source code](src/jvmDemo/kotlin/DemoProxyProgram02.kt) +[source code](src/jvmDemo/kotlin/DemoProxyProgram01.kt) +### DemoProxyProgram02 + +Demonstrates how to use two proxy programs and +toggle between them by clicking the mouse. + +programA draws a circle and can be moved by pressing the +arrow keys. + +programB draws a ring located at the current mouse +position. + +Note that programA keeps listening to the key events +even if programB is currently displayed. ![DemoProxyProgram02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-view-box/images/DemoProxyProgram02Kt.png) -### DemoUpdate01 -[source code](src/jvmDemo/kotlin/DemoUpdate01.kt) +[source code](src/jvmDemo/kotlin/DemoProxyProgram02.kt) +### DemoUpdate01 + +Demonstrates how to create a viewBox with an interactive 2D camera and +display it multiple times. + +Instead of calling the viewBox's `.draw()` method multiple times, +we call its `.update()` method once, then draw its `.result` +repeatedly, in a grid of 4 columns and 4 rows. + +The camera's initial rotation and scaling are specified as a transformation matrix. +To control the camera use the mouse wheel and buttons on the top-left view. ![DemoUpdate01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-view-box/images/DemoUpdate01Kt.png) +[source code](src/jvmDemo/kotlin/DemoUpdate01.kt) + ### DemoViewBox01 -[source code](src/jvmDemo/kotlin/DemoViewBox01.kt) + +Demonstrates how to draw multiple view boxes. The first two feature +interactive 2D cameras, the third one uses an Orbital 3D camera. +All three can be controlled with the mouse wheel and buttons. + +The `shouldDraw` viewBox variable is used to avoid re-rendering the view +unnecessarily when the camera has not changed. ![DemoViewBox01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-view-box/images/DemoViewBox01Kt.png) + +[source code](src/jvmDemo/kotlin/DemoViewBox01.kt)