add orx-jvm demos to README.md
This commit is contained in:
@@ -26,7 +26,16 @@ this addon provides some helper functions to convert them to OPENRNDR types:
|
|||||||
## Demos
|
## Demos
|
||||||
### DemoContours01
|
### DemoContours01
|
||||||
|
|
||||||
|
Demonstrates how to convert a PNG image into `ShapeContour`s using BoofCV.
|
||||||
|
|
||||||
|
Two helper methods help convert data types between BoofCV and OPENRNDR.
|
||||||
|
|
||||||
|
The `ColorBuffer.toGrayF32()` method converts an OPENRNDR `ColorBuffer` to `GrayF32` format,
|
||||||
|
required by BoofCV.
|
||||||
|
|
||||||
|
The `.toShapeContours()` converts BoofCV contours to OPENRNDR `ShapeContour` instances.
|
||||||
|
|
||||||
|
The resulting contours are animated zooming in and out while their colors change slowly.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -34,7 +43,8 @@ this addon provides some helper functions to convert them to OPENRNDR types:
|
|||||||
|
|
||||||
### DemoResize01
|
### DemoResize01
|
||||||
|
|
||||||
|
Demonstrates how to scale down images using the `resizeBy` BoofCV-based
|
||||||
|
method.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -42,7 +52,11 @@ this addon provides some helper functions to convert them to OPENRNDR types:
|
|||||||
|
|
||||||
### DemoResize02
|
### DemoResize02
|
||||||
|
|
||||||
|
Demonstrates how to scale down images using the `resizeTo` BoofCV-based
|
||||||
|
method.
|
||||||
|
|
||||||
|
If only the `newWidth` or the `newHeight` arguments are specified,
|
||||||
|
the resizing happens maintaining the original aspect ratio.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -50,7 +64,16 @@ this addon provides some helper functions to convert them to OPENRNDR types:
|
|||||||
|
|
||||||
### DemoSimplified01
|
### DemoSimplified01
|
||||||
|
|
||||||
|
When converting a `ColorBuffer` to `ShapeContour` instances using
|
||||||
|
`BoofCV`, simple shapes can have hundreds of segments and vertices.
|
||||||
|
|
||||||
|
This demo shows how to use the `simplify()` method to greatly
|
||||||
|
reduce the number of vertices.
|
||||||
|
|
||||||
|
Then it uses the simplified vertex lists to create smooth curves
|
||||||
|
(using `CatmullRomChain2`) and polygonal curves (using `ShapeContour.fromPoints`).
|
||||||
|
|
||||||
|
Study the console to learn about the number of segments before and after simplification.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -178,7 +178,10 @@ import org.openrndr.extra.parameters.DoubleParameter
|
|||||||
## Demos
|
## Demos
|
||||||
### DemoAppearance01
|
### DemoAppearance01
|
||||||
|
|
||||||
A simple demonstration of a GUI for drawing some circles
|
Demonstrates how to customize the appearance of the GUI by using
|
||||||
|
`GUIAppearance()`.
|
||||||
|
|
||||||
|
In this demo, we make the GUI wider (400 pixels) and translucent.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -186,7 +189,7 @@ A simple demonstration of a GUI for drawing some circles
|
|||||||
|
|
||||||
### DemoHide01
|
### DemoHide01
|
||||||
|
|
||||||
A simple demonstration of a GUI for drawing some circles
|
Demonstrates how to hide the GUI when the mouse pointer is outside of it.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -194,15 +197,38 @@ A simple demonstration of a GUI for drawing some circles
|
|||||||
|
|
||||||
### DemoOptions01
|
### DemoOptions01
|
||||||
|
|
||||||
A simple demonstration of a GUI with a drop down menu
|
A simple demonstration of a GUI with a drop-down menu.
|
||||||
|
|
||||||
|
The entries in the drop-down menu are taken from an `enum class`.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
[source code](src/demo/kotlin/DemoOptions01.kt)
|
[source code](src/demo/kotlin/DemoOptions01.kt)
|
||||||
|
|
||||||
|
### DemoOptions02
|
||||||
|
|
||||||
|
A simple demonstration of a GUI with a drop-down menu.
|
||||||
|
|
||||||
|
The entries in the drop-down menu are taken from an `enum class`.
|
||||||
|
The `enum class` entries contain both a name (used in the drop-down)
|
||||||
|
and a `ColorRGBa` instance (used for rendering).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[source code](src/demo/kotlin/DemoOptions02.kt)
|
||||||
|
|
||||||
### DemoPath01
|
### DemoPath01
|
||||||
|
|
||||||
|
Demonstrates how to include a button for loading images in a GUI, and how to display
|
||||||
|
the loaded image.
|
||||||
|
|
||||||
|
The program applies the `@PathParameter` annotation to a `String` variable, which gets
|
||||||
|
rendered by the GUI as an image-picker button. Note the allowed file `extensions`.
|
||||||
|
|
||||||
|
This mechanism only updates the `String` containing the path of an image file.
|
||||||
|
|
||||||
|
The `watchingImagePath()` delegate property is used to automatically load an image
|
||||||
|
when its `String` argument changes.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -210,9 +236,11 @@ A simple demonstration of a GUI with a drop down menu
|
|||||||
|
|
||||||
### DemoPresets01
|
### DemoPresets01
|
||||||
|
|
||||||
Shows how to store and retrieve in-memory gui presets.
|
Shows how to store and retrieve in-memory GUI presets,
|
||||||
|
each containing two integer values and two colors.
|
||||||
|
|
||||||
Keyboard controls:
|
Keyboard controls:
|
||||||
[Left Shift] + [0]..[9] => store current gui values to a preset
|
[Left Shift] + [0]..[9] => store current GUI values to a preset
|
||||||
[0]..[9] => recall a preset
|
[0]..[9] => recall a preset
|
||||||
|
|
||||||

|

|
||||||
@@ -221,7 +249,17 @@ Keyboard controls:
|
|||||||
|
|
||||||
### DemoSideCanvas01
|
### DemoSideCanvas01
|
||||||
|
|
||||||
A simple demonstration of a GUI for drawing some circles
|
Demonstrates the `GUI.enableSideCanvas` feature.
|
||||||
|
|
||||||
|
When set to true, the `GUI` provides a `canvas` property where one can draw.
|
||||||
|
The size of this canvas is the window size minus the GUI size.
|
||||||
|
|
||||||
|
That's why if we draw a circle at `drawer.width / 2.0` it is centered
|
||||||
|
on the `canvas`, not on the window.
|
||||||
|
|
||||||
|
This demo sets the window to resizable, so if you resize the window
|
||||||
|
you should see tha the circle stays at the center of the canvas.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -229,7 +267,15 @@ A simple demonstration of a GUI for drawing some circles
|
|||||||
|
|
||||||
### DemoSimple01
|
### DemoSimple01
|
||||||
|
|
||||||
A simple demonstration of a GUI for drawing some circles
|
Demonstrates how to create a simple GUI with 4 inputs:
|
||||||
|
- A `ColorParameter` which creates a color picker.
|
||||||
|
- A `DoubleParameter` to control the radius of a circle.
|
||||||
|
- A `Vector2Parameter` to set the position of that circle.
|
||||||
|
- A `DoubleListParameter` which sets the radii of six circles.
|
||||||
|
|
||||||
|
The demo also shows how to use the variables controlled by the GUI
|
||||||
|
inside the program, so changes to those variables affect
|
||||||
|
the rendering in real time.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -237,6 +283,10 @@ A simple demonstration of a GUI for drawing some circles
|
|||||||
|
|
||||||
### DemoXYParameter
|
### DemoXYParameter
|
||||||
|
|
||||||
|
Demonstrates the use of the `@XYParameter` annotation applied to a `Vector2` variable.
|
||||||
|
|
||||||
|
This annotation creates an interactive XY control in a GUI that can be used to update
|
||||||
|
a `Vector2` variable. In this demo it sets the position of a circle.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -42,7 +42,15 @@ More info about the web client:
|
|||||||
## Demos
|
## Demos
|
||||||
### DemoRabbitControl
|
### DemoRabbitControl
|
||||||
|
|
||||||
|
Demonstrates how to use RabbitControl to create a web-based user interface for your program.
|
||||||
|
|
||||||
|
A `settings` object is created using the same syntax used for `orx-gui`, including
|
||||||
|
annotations for different variable types.
|
||||||
|
|
||||||
|
The program then passes these `settings` to the `RabbitControlServer`. A QR-code is displayed
|
||||||
|
to open the web user interface. A clickable URL is also displayed in the console.
|
||||||
|
|
||||||
|
Once the UI is visible in a web browser we can use it to control the OPENRNDR program.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -50,7 +58,10 @@ More info about the web client:
|
|||||||
|
|
||||||
### DemoRabbitControlManualOverlay
|
### DemoRabbitControlManualOverlay
|
||||||
|
|
||||||
|
Demonstrates how the QR-code pointing at the Rabbit Control web-based user interface
|
||||||
|
can be displayed and hidden manually.
|
||||||
|
|
||||||
|
To display the QR-code overlay in this demo, hold down the HOME key in the keyboard.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -58,6 +69,12 @@ More info about the web client:
|
|||||||
|
|
||||||
### DemoRabbitHole
|
### DemoRabbitHole
|
||||||
|
|
||||||
|
Starts the RabbitControlServer with a `Rabbithole` using the key 'orxtest'.
|
||||||
|
|
||||||
|
`Rabbithole` allows you to access your exposed parameters from Internet
|
||||||
|
connected computers that are not in the same network.
|
||||||
|
|
||||||
|
To use it with this example use 'orxtest' as the tunnel-name in https://rabbithole.rabbitcontrol.cc
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
Reference in New Issue
Block a user