add demos to README.md
This commit is contained in:
@@ -59,36 +59,78 @@ fun main() = application {
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoCamera2D01
|
||||
[source code](src/jvmDemo/kotlin/DemoCamera2D01.kt)
|
||||
|
||||
# Camera2D demo
|
||||
|
||||
click and drag the mouse for panning, use the mouse wheel for zooming
|
||||

|
||||
|
||||
### 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
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
### 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.
|
||||

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

|
||||
|
||||
### 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.
|
||||

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

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoParametricOrbital01.kt)
|
||||
|
||||
@@ -50,156 +50,300 @@ Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an impleme
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### colormap/DemoSpectralZucconiColormap
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormap.kt)
|
||||
|
||||
|
||||

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

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

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

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

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

|
||||
|
||||
### 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/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/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/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.
|
||||

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

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

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

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

|
||||
|
||||
### 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
|
||||

|
||||
|
||||
### 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.
|
||||

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

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

|
||||
|
||||
### 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.
|
||||

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

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

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

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

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

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

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

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

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

|
||||
|
||||
### 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/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/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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/histogram/DemoHistogram03.kt)
|
||||
|
||||
@@ -17,26 +17,61 @@ _The code in `orx-composition` was previously found under `openrndr-draw` in the
|
||||
<!-- __demos__ -->
|
||||
## 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
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
[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.
|
||||
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
### 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
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoCompositionDrawer05.kt)
|
||||
|
||||
@@ -238,16 +238,25 @@ fun main() = application {
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoAside01
|
||||
[source code](src/jvmDemo/kotlin/DemoAside01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### 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
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoCompositor02.kt)
|
||||
|
||||
@@ -40,21 +40,49 @@ val radiusHistory by tracking(state::radius)
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoDifferencing01
|
||||
[source code](src/jvmDemo/kotlin/DemoDifferencing01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### 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.
|
||||

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

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

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoSpring01.kt)
|
||||
|
||||
@@ -94,6 +94,11 @@ println(Easing.values().size)
|
||||
<!-- __demos__ -->
|
||||
## 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.
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoEasings01.kt)
|
||||
|
||||
@@ -8,11 +8,15 @@ Attack, decay, sustain, release
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoADSRTracker01
|
||||
[source code](src/jvmDemo/kotlin/DemoADSRTracker01.kt)
|
||||
|
||||
|
||||

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

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoADSRTracker02.kt)
|
||||
|
||||
@@ -83,11 +83,16 @@ xFunction(1.0)
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoExpressionEvaluator01
|
||||
[source code](src/jvmDemo/kotlin/DemoExpressionEvaluator01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### 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".
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoExpressionEvaluator02.kt)
|
||||
|
||||
@@ -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__ -->
|
||||
## Demos
|
||||
### DemoFCurve01
|
||||
[source code](src/jvmDemo/kotlin/DemoFCurve01.kt)
|
||||
|
||||
|
||||

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

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

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

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoMultiFCurve01.kt)
|
||||
|
||||
@@ -6,6 +6,9 @@ The FFT routine found in `orx-fft` is a Kotlin port of Minim's FFT routine.
|
||||
<!-- __demos__ -->
|
||||
## 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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoFFTShape01.kt)
|
||||
|
||||
111
orx-fx/README.md
111
orx-fx/README.md
@@ -194,101 +194,164 @@ shaping `curve` within this range:
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoApproximateGaussianBlur01
|
||||
[source code](src/jvmDemo/kotlin/DemoApproximateGaussianBlur01.kt)
|
||||
|
||||
|
||||

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

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

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

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

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

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

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

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

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

|
||||
|
||||
### DemoContour01
|
||||
[source code](src/jvmDemo/kotlin/DemoContour01.kt)
|
||||
[source code](src/jvmDemo/kotlin/DemoCompositeFilter01.kt)
|
||||
|
||||
### DemoContour01
|
||||
|
||||
Demonstrate the Contour filter
|
||||
@author Edwin Jakobs
|
||||

|
||||
|
||||
[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.
|
||||
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
### 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.
|
||||

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

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

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

|
||||
|
||||
### 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.
|
||||

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

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

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoSpectralBlend01.kt)
|
||||
|
||||
@@ -68,16 +68,39 @@ val hashGrid = points.hashGrid(20.0)
|
||||
<!-- __demos__ -->
|
||||
## 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.
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoHashGrid01.kt)
|
||||
|
||||
@@ -71,11 +71,15 @@ fun main() = application {
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoImageFit01
|
||||
[source code](src/jvmDemo/kotlin/DemoImageFit01.kt)
|
||||
|
||||
Tests `drawer.imageFit()` with all FitMethods for portrait and landscape images.
|
||||

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

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoImageFitSub01.kt)
|
||||
|
||||
@@ -5,11 +5,15 @@ CPU and GPU-based implementation for integral images (summed area tables)
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoFII01
|
||||
[source code](src/demo/kotlin/DemoFII01.kt)
|
||||
|
||||
Apply box blurs with large windows
|
||||

|
||||
|
||||
### DemoFII02
|
||||
[source code](src/demo/kotlin/DemoFII02.kt)
|
||||
[source code](src/demo/kotlin/DemoFII01.kt)
|
||||
|
||||
### DemoFII02
|
||||
|
||||
Implement an FM like video synthesizer using [FastIntegralImage]
|
||||

|
||||
|
||||
[source code](src/demo/kotlin/DemoFII02.kt)
|
||||
|
||||
@@ -156,76 +156,123 @@ fun main() = application {
|
||||
<!-- __demos__ -->
|
||||
## 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.
|
||||

|
||||
|
||||
### DemoDirectionField02
|
||||
[source code](src/jvmDemo/kotlin/DemoDirectionField02.kt)
|
||||
[source code](src/jvmDemo/kotlin/DemoDirectionField01.kt)
|
||||
|
||||
### DemoDirectionField02
|
||||
|
||||
Create directional distance field and demonstrate signed distance
|
||||

|
||||
|
||||
### 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.
|
||||

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

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

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

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

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

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

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

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

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

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

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

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

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoVoronoi03.kt)
|
||||
|
||||
@@ -5,16 +5,50 @@ Fast search of points closest to the queried point in a data set. 2D, 3D and 4D.
|
||||
<!-- __demos__ -->
|
||||
## 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.
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoRangeQuery01.kt)
|
||||
|
||||
@@ -22,21 +22,29 @@ drawer.contours(contours)
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### FindContours01
|
||||
[source code](src/jvmDemo/kotlin/FindContours01.kt)
|
||||
|
||||
|
||||

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

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

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

|
||||
|
||||
[source code](src/jvmDemo/kotlin/FindContours04.kt)
|
||||
|
||||
@@ -4,36 +4,55 @@ Mathematical utilities
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### linearrange/DemoLinearRange02
|
||||
[source code](src/jvmDemo/kotlin/linearrange/DemoLinearRange02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/linearrange/DemoLinearRange02.kt)
|
||||
|
||||
### linearrange/DemoLinearRange03
|
||||
[source code](src/jvmDemo/kotlin/linearrange/DemoLinearRange03.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### 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/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
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/matrix/DemoLeastSquares02.kt)
|
||||
|
||||
### rbf/RbfInterpolation01
|
||||
[source code](src/jvmDemo/kotlin/rbf/RbfInterpolation01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/rbf/RbfInterpolation01.kt)
|
||||
|
||||
### rbf/RbfInterpolation02
|
||||
[source code](src/jvmDemo/kotlin/rbf/RbfInterpolation02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/rbf/RbfInterpolation02.kt)
|
||||
|
||||
### simplexrange/DemoSimplexRange3D01
|
||||
[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexRange3D01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexRange3D01.kt)
|
||||
|
||||
@@ -86,86 +86,128 @@ Check out the [source code](src/commonMain/kotlin) to learn about function argum
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### decal/DemoDecal01
|
||||
[source code](src/jvmDemo/kotlin/decal/DemoDecal01.kt)
|
||||
|
||||
Demonstrate decal generator as an object slicer
|
||||
@see <img src="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 <img src="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)
|
||||
|
||||
|
||||

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

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

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

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

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

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

|
||||
|
||||
[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.
|
||||
|
||||

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

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

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

|
||||
|
||||
[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.
|
||||
|
||||

|
||||
|
||||
[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.
|
||||
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoExtrude06.kt)
|
||||
|
||||
### tangents/DemoTangents01
|
||||
[source code](src/jvmDemo/kotlin/tangents/DemoTangents01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/tangents/DemoTangents01.kt)
|
||||
|
||||
@@ -4,21 +4,59 @@ Generate random samples on the surface of a mesh
|
||||
<!-- __demos__ -->
|
||||
## 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.
|
||||

|
||||
|
||||
### 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
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoNonUniformMeshNoise01.kt)
|
||||
|
||||
@@ -54,6 +54,8 @@ NB! any submitted _lambda expression_ must be valid within the `renderTarget` co
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoNoClear
|
||||
[source code](src/jvmDemo/kotlin/DemoNoClear.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoNoClear.kt)
|
||||
|
||||
@@ -188,131 +188,265 @@ val v8 = billow(seed, x, y, z, ::perlinLinear, octaves, lacunarity, gain)
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoCubicNoise2D01
|
||||
[source code](src/jvmDemo/kotlin/DemoCubicNoise2D01.kt)
|
||||
|
||||
|
||||

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

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

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

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

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

|
||||
|
||||
### 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 <img src="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)
|
||||
|
||||
|
||||

|
||||
|
||||
### 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/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/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
|
||||

|
||||
|
||||
### 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/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/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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/hammersley/DemoHammersley4D01.kt)
|
||||
|
||||
### hash/DemoCircleHash01
|
||||
[source code](src/jvmDemo/kotlin/hash/DemoCircleHash01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/hash/DemoCircleHash01.kt)
|
||||
|
||||
### hash/DemoRectangleHash01
|
||||
[source code](src/jvmDemo/kotlin/hash/DemoRectangleHash01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/hash/DemoRectangleHash01.kt)
|
||||
|
||||
### hash/DemoUHash01
|
||||
[source code](src/jvmDemo/kotlin/hash/DemoUHash01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/hash/DemoUHash01.kt)
|
||||
|
||||
### linearrange/DemoLinearRange01
|
||||
[source code](src/jvmDemo/kotlin/linearrange/DemoLinearRange01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### 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
|
||||

|
||||
|
||||
### 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/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/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.
|
||||

|
||||
|
||||
### 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/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/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/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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/simplexrange/DemoSimplexUniform02.kt)
|
||||
|
||||
@@ -25,26 +25,36 @@ vertexBuffer.saveOBJ("my/path/exported.obj")
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoObjCompoundRW01
|
||||
[source code](src/jvmDemo/kotlin/DemoObjCompoundRW01.kt)
|
||||
|
||||
|
||||

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

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

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

|
||||
|
||||
### DemoWireframe01
|
||||
[source code](src/jvmDemo/kotlin/DemoWireframe01.kt)
|
||||
[source code](src/jvmDemo/kotlin/DemoObjSaver02.kt)
|
||||
|
||||
### DemoWireframe01
|
||||
|
||||
Display wireframe and non-planar faces
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoWireframe01.kt)
|
||||
|
||||
@@ -5,11 +5,15 @@ Tools for setting up property watcher based pipelines
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoImagePathWatcher01
|
||||
[source code](src/jvmDemo/kotlin/DemoImagePathWatcher01.kt)
|
||||
|
||||
|
||||

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

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoPropertyWatchers01.kt)
|
||||
|
||||
@@ -23,11 +23,15 @@ Ricardo Matias / [@ricardomatias](https://github.com/ricardomatias)
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoQuadTree01
|
||||
[source code](src/jvmDemo/kotlin/DemoQuadTree01.kt)
|
||||
|
||||
|
||||

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

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoQuadTree02.kt)
|
||||
|
||||
@@ -9,121 +9,181 @@ Shader based fills and strokes, including various types of gradient fills.
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### clip/DemoClip01
|
||||
[source code](src/jvmDemo/kotlin/clip/DemoClip01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/clip/DemoClip01.kt)
|
||||
|
||||
### clip/DemoClip02
|
||||
[source code](src/jvmDemo/kotlin/clip/DemoClip02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/clip/DemoClip02.kt)
|
||||
|
||||
### clip/DemoClip03
|
||||
[source code](src/jvmDemo/kotlin/clip/DemoClip03.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/composed/DemoComposed01.kt)
|
||||
|
||||
### gradients/DemoGradient01
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient01.kt)
|
||||
|
||||
### gradients/DemoGradient02
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient02.kt)
|
||||
|
||||
### gradients/DemoGradient03
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient03.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient03.kt)
|
||||
|
||||
### gradients/DemoGradient04
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient04.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient04.kt)
|
||||
|
||||
### gradients/DemoGradient05
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient05.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient05.kt)
|
||||
|
||||
### gradients/DemoGradient06
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient06.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient06.kt)
|
||||
|
||||
### gradients/DemoGradient07
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient07.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient07.kt)
|
||||
|
||||
### gradients/DemoGradient08
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient08.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient08.kt)
|
||||
|
||||
### gradients/DemoGradient09
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient09.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/gradients/DemoGradient09.kt)
|
||||
|
||||
### image/DemoImageFill01
|
||||
[source code](src/jvmDemo/kotlin/image/DemoImageFill01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/image/DemoImageFill01.kt)
|
||||
|
||||
### image/DemoImageFill02
|
||||
[source code](src/jvmDemo/kotlin/image/DemoImageFill02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/image/DemoImageFill02.kt)
|
||||
|
||||
### image/DemoImageFill03
|
||||
[source code](src/jvmDemo/kotlin/image/DemoImageFill03.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/image/DemoImageFill03.kt)
|
||||
|
||||
### noise/DemoBlueNoise01
|
||||
[source code](src/jvmDemo/kotlin/noise/DemoBlueNoise01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/noise/DemoBlueNoise01.kt)
|
||||
|
||||
### noise/DemoSimplex01
|
||||
[source code](src/jvmDemo/kotlin/noise/DemoSimplex01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/noise/DemoSimplex01.kt)
|
||||
|
||||
### noise/DemoWhiteNoise01
|
||||
[source code](src/jvmDemo/kotlin/noise/DemoWhiteNoise01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/noise/DemoWhiteNoise01.kt)
|
||||
|
||||
### patterns/DemoPatterns01
|
||||
[source code](src/jvmDemo/kotlin/patterns/DemoPatterns01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/patterns/DemoPatterns01.kt)
|
||||
|
||||
### patterns/DemoPatterns02
|
||||
[source code](src/jvmDemo/kotlin/patterns/DemoPatterns02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/patterns/DemoPatterns02.kt)
|
||||
|
||||
### patterns/DemoPatterns03
|
||||
[source code](src/jvmDemo/kotlin/patterns/DemoPatterns03.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/patterns/DemoPatterns03.kt)
|
||||
|
||||
### spatial/DemoHemisphere01
|
||||
[source code](src/jvmDemo/kotlin/spatial/DemoHemisphere01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/spatial/DemoHemisphere01.kt)
|
||||
|
||||
### spatial/DemoVisualizeNormals01
|
||||
[source code](src/jvmDemo/kotlin/spatial/DemoVisualizeNormals01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/spatial/DemoVisualizeNormals01.kt)
|
||||
|
||||
@@ -5,316 +5,495 @@ Collection of 2D shape generators and modifiers.
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### adjust/DemoAdjustContour01
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour01.kt)
|
||||
|
||||
### adjust/DemoAdjustContour02
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour02.kt)
|
||||
|
||||
### adjust/DemoAdjustContour03
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour03.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour03.kt)
|
||||
|
||||
### adjust/DemoAdjustContour04
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour04.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour04.kt)
|
||||
|
||||
### adjust/DemoAdjustContour05
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour05.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour05.kt)
|
||||
|
||||
### adjust/DemoAdjustContour06
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour06.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour06.kt)
|
||||
|
||||
### adjust/DemoAdjustContour07
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour07.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour07.kt)
|
||||
|
||||
### adjust/DemoAdjustContour08
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour08.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour08.kt)
|
||||
|
||||
### adjust/DemoAdjustContour09
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour09.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContour09.kt)
|
||||
|
||||
### adjust/DemoAdjustContourContinue01
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContourContinue01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/adjust/DemoAdjustContourContinue01.kt)
|
||||
|
||||
### alphashape/DemoAlphaShape
|
||||
[source code](src/jvmDemo/kotlin/alphashape/DemoAlphaShape.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/alphashape/DemoAlphaShape.kt)
|
||||
|
||||
### arrangement/DemoArrangement01
|
||||
[source code](src/jvmDemo/kotlin/arrangement/DemoArrangement01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/arrangement/DemoArrangement01.kt)
|
||||
|
||||
### arrangement/DemoArrangement02
|
||||
[source code](src/jvmDemo/kotlin/arrangement/DemoArrangement02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/arrangement/DemoArrangement02.kt)
|
||||
|
||||
### arrangement/DemoArrangement04
|
||||
[source code](src/jvmDemo/kotlin/arrangement/DemoArrangement04.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### 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/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/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/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/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.
|
||||

|
||||
|
||||
[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
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch06.kt)
|
||||
|
||||
### bezierpatch/DemoBezierPatchDrawer01
|
||||
[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer01.kt)
|
||||
|
||||
### bezierpatch/DemoBezierPatchDrawer02
|
||||
[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer02.kt)
|
||||
|
||||
### bezierpatch/DemoBezierPatchDrawer03
|
||||
[source code](src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer03.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
### 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/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
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/blend/DemoContourBlend02.kt)
|
||||
|
||||
### frames/DemoFrames01
|
||||
[source code](src/jvmDemo/kotlin/frames/DemoFrames01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/frames/DemoFrames01.kt)
|
||||
|
||||
### hobbycurve/DemoHobbyCurve01
|
||||
[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve01.kt)
|
||||
|
||||
### hobbycurve/DemoHobbyCurve02
|
||||
[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve02.kt)
|
||||
|
||||
### hobbycurve/DemoHobbyCurve03
|
||||
[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve03.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve03.kt)
|
||||
|
||||
### hobbycurve/DemoHobbyCurve3D01
|
||||
[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve3D01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve3D01.kt)
|
||||
|
||||
### operators/DemoRoundCorners01
|
||||
[source code](src/jvmDemo/kotlin/operators/DemoRoundCorners01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/operators/DemoRoundCorners01.kt)
|
||||
|
||||
### ordering/DemoHilbertOrder01
|
||||
[source code](src/jvmDemo/kotlin/ordering/DemoHilbertOrder01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/ordering/DemoHilbertOrder01.kt)
|
||||
|
||||
### ordering/DemoHilbertOrder02
|
||||
[source code](src/jvmDemo/kotlin/ordering/DemoHilbertOrder02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/ordering/DemoHilbertOrder02.kt)
|
||||
|
||||
### path3d/DemoPath3DProjection
|
||||
[source code](src/jvmDemo/kotlin/path3d/DemoPath3DProjection.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/path3d/DemoPath3DProjection.kt)
|
||||
|
||||
### primitives/DemoArc01
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoArc01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoArc01.kt)
|
||||
|
||||
### primitives/DemoCircleInversion01
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoCircleInversion01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoCircleInversion01.kt)
|
||||
|
||||
### primitives/DemoCircleInversion02
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoCircleInversion02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoCircleInversion02.kt)
|
||||
|
||||
### primitives/DemoCircleInversion03
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoCircleInversion03.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoCircleInversion03.kt)
|
||||
|
||||
### primitives/DemoNet01
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoNet01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoNet01.kt)
|
||||
|
||||
### primitives/DemoPulley01
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoPulley01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRectangleDistribute01.kt)
|
||||
|
||||
### primitives/DemoRectangleFitHorizontally
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRectangleFitHorizontally.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRectangleFitHorizontally.kt)
|
||||
|
||||
### primitives/DemoRectangleGrid01
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRectangleGrid01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRectangleGrid01.kt)
|
||||
|
||||
### primitives/DemoRectangleGrid02
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRectangleGrid02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRectangleGrid02.kt)
|
||||
|
||||
### primitives/DemoRectangleGrid03
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRectangleGrid03.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### 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 <img src="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/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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRectanglePlace01.kt)
|
||||
|
||||
### primitives/DemoRegularPolygon
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRegularPolygon.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRegularPolygon.kt)
|
||||
|
||||
### primitives/DemoRegularStar01
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRegularStar01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRegularStar01.kt)
|
||||
|
||||
### primitives/DemoRegularStar02
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRegularStar02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRegularStar02.kt)
|
||||
|
||||
### primitives/DemoRoundedRectangle
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRoundedRectangle.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoRoundedRectangle.kt)
|
||||
|
||||
### primitives/DemoSplit01
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoSplit01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoSplit01.kt)
|
||||
|
||||
### primitives/DemoTear01
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoTear01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/primitives/DemoTear01.kt)
|
||||
|
||||
### rectify/DemoRectifiedContour01
|
||||
[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour01.kt)
|
||||
|
||||
### rectify/DemoRectifiedContour02
|
||||
[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour02.kt)
|
||||
|
||||
### rectify/DemoRectifiedContour03
|
||||
[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour03.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour03.kt)
|
||||
|
||||
### rectify/DemoRectifiedContour04
|
||||
[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour04.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedContour04.kt)
|
||||
|
||||
### rectify/DemoRectifiedPath3D01
|
||||
[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedPath3D01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/rectify/DemoRectifiedPath3D01.kt)
|
||||
|
||||
### text/DemoText01
|
||||
[source code](src/jvmDemo/kotlin/text/DemoText01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/text/DemoText01.kt)
|
||||
|
||||
### tunni/DemoTunniAdjuster01
|
||||
[source code](src/jvmDemo/kotlin/tunni/DemoTunniAdjuster01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/tunni/DemoTunniAdjuster01.kt)
|
||||
|
||||
### tunni/DemoTunniPoint01
|
||||
[source code](src/jvmDemo/kotlin/tunni/DemoTunniPoint01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/tunni/DemoTunniPoint01.kt)
|
||||
|
||||
@@ -42,11 +42,15 @@ extend(TemporalBlur()) {
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoBasic01
|
||||
[source code](src/demo/kotlin/DemoBasic01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/demo/kotlin/DemoBasic01.kt)
|
||||
|
||||
### DemoColorShift01
|
||||
[source code](src/demo/kotlin/DemoColorShift01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/demo/kotlin/DemoColorShift01.kt)
|
||||
|
||||
@@ -5,6 +5,12 @@ Writing texts on contours.
|
||||
<!-- __demos__ -->
|
||||
## 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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoTextOnContour01.kt)
|
||||
|
||||
@@ -9,16 +9,37 @@ _The code in `orx-text-writer` was previously found under `openrndr-draw` in the
|
||||
<!-- __demos__ -->
|
||||
## 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.
|
||||

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

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

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoTextWriter03.kt)
|
||||
|
||||
@@ -56,11 +56,15 @@ drawer.circle(0.0, 0.0, size.sine(freq, phase))
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoEnvelope
|
||||
[source code](src/demo/kotlin/DemoEnvelope.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/demo/kotlin/DemoEnvelope.kt)
|
||||
|
||||
### DemoLFO
|
||||
[source code](src/demo/kotlin/DemoLFO.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/demo/kotlin/DemoLFO.kt)
|
||||
|
||||
@@ -36,16 +36,22 @@ Note that drawing inside the `repeat` action has no effect. Have a look at the d
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoRepeat01
|
||||
[source code](src/demo/kotlin/DemoRepeat01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### 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
|
||||

|
||||
|
||||
[source code](src/demo/kotlin/DemoRepeat02.kt)
|
||||
|
||||
### DemoTimeOut01
|
||||
[source code](src/demo/kotlin/DemoTimeOut01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/demo/kotlin/DemoTimeOut01.kt)
|
||||
|
||||
@@ -65,26 +65,58 @@ Edwin Jakobs / [@edwinRNDR](https://github.com/edwinRNDR)
|
||||
<!-- __demos__ -->
|
||||
## 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.
|
||||

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

|
||||
|
||||
### 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.
|
||||

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

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

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoVoronoi03.kt)
|
||||
|
||||
@@ -34,16 +34,25 @@ The language also holds some tools to manage the position and orientation of the
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### DemoTurtle01
|
||||
[source code](src/jvmDemo/kotlin/DemoTurtle01.kt)
|
||||
|
||||
/*
|
||||
Drawing a square using the turtle interface.
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoTurtle03.kt)
|
||||
|
||||
@@ -5,21 +5,55 @@ To create independent views inside one program window.
|
||||
<!-- __demos__ -->
|
||||
## 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.
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
### 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.
|
||||

|
||||
|
||||
[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.
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoViewBox01.kt)
|
||||
|
||||
Reference in New Issue
Block a user