Skip to content

Commit 6024e62

Browse files
committed
add orx-jvm demos to README.md
1 parent 4af2ed3 commit 6024e62

File tree

3 files changed

+98
-8
lines changed

3 files changed

+98
-8
lines changed

orx-jvm/orx-boofcv/README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,54 @@ this addon provides some helper functions to convert them to OPENRNDR types:
2626
## Demos
2727
### DemoContours01
2828

29+
Demonstrates how to convert a PNG image into `ShapeContour`s using BoofCV.
2930

31+
Two helper methods help convert data types between BoofCV and OPENRNDR.
32+
33+
The `ColorBuffer.toGrayF32()` method converts an OPENRNDR `ColorBuffer` to `GrayF32` format,
34+
required by BoofCV.
35+
36+
The `.toShapeContours()` converts BoofCV contours to OPENRNDR `ShapeContour` instances.
37+
38+
The resulting contours are animated zooming in and out while their colors change slowly.
3039

3140
![DemoContours01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-boofcv/images/DemoContours01Kt.png)
3241

3342
[source code](src/demo/kotlin/DemoContours01.kt)
3443

3544
### DemoResize01
3645

37-
46+
Demonstrates how to scale down images using the `resizeBy` BoofCV-based
47+
method.
3848

3949
![DemoResize01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-boofcv/images/DemoResize01Kt.png)
4050

4151
[source code](src/demo/kotlin/DemoResize01.kt)
4252

4353
### DemoResize02
4454

55+
Demonstrates how to scale down images using the `resizeTo` BoofCV-based
56+
method.
4557

58+
If only the `newWidth` or the `newHeight` arguments are specified,
59+
the resizing happens maintaining the original aspect ratio.
4660

4761
![DemoResize02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-boofcv/images/DemoResize02Kt.png)
4862

4963
[source code](src/demo/kotlin/DemoResize02.kt)
5064

5165
### DemoSimplified01
5266

67+
When converting a `ColorBuffer` to `ShapeContour` instances using
68+
`BoofCV`, simple shapes can have hundreds of segments and vertices.
69+
70+
This demo shows how to use the `simplify()` method to greatly
71+
reduce the number of vertices.
72+
73+
Then it uses the simplified vertex lists to create smooth curves
74+
(using `CatmullRomChain2`) and polygonal curves (using `ShapeContour.fromPoints`).
5375

76+
Study the console to learn about the number of segments before and after simplification.
5477

5578
![DemoSimplified01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-boofcv/images/DemoSimplified01Kt.png)
5679

orx-jvm/orx-gui/README.md

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,41 +178,69 @@ import org.openrndr.extra.parameters.DoubleParameter
178178
## Demos
179179
### DemoAppearance01
180180

181-
A simple demonstration of a GUI for drawing some circles
181+
Demonstrates how to customize the appearance of the GUI by using
182+
`GUIAppearance()`.
183+
184+
In this demo, we make the GUI wider (400 pixels) and translucent.
182185

183186
![DemoAppearance01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoAppearance01Kt.png)
184187

185188
[source code](src/demo/kotlin/DemoAppearance01.kt)
186189

187190
### DemoHide01
188191

189-
A simple demonstration of a GUI for drawing some circles
192+
Demonstrates how to hide the GUI when the mouse pointer is outside of it.
190193

191194
![DemoHide01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoHide01Kt.png)
192195

193196
[source code](src/demo/kotlin/DemoHide01.kt)
194197

195198
### DemoOptions01
196199

197-
A simple demonstration of a GUI with a drop down menu
200+
A simple demonstration of a GUI with a drop-down menu.
201+
202+
The entries in the drop-down menu are taken from an `enum class`.
198203

199204
![DemoOptions01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoOptions01Kt.png)
200205

201206
[source code](src/demo/kotlin/DemoOptions01.kt)
202207

208+
### DemoOptions02
209+
210+
A simple demonstration of a GUI with a drop-down menu.
211+
212+
The entries in the drop-down menu are taken from an `enum class`.
213+
The `enum class` entries contain both a name (used in the drop-down)
214+
and a `ColorRGBa` instance (used for rendering).
215+
216+
![DemoOptions02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoOptions02Kt.png)
217+
218+
[source code](src/demo/kotlin/DemoOptions02.kt)
219+
203220
### DemoPath01
204221

222+
Demonstrates how to include a button for loading images in a GUI, and how to display
223+
the loaded image.
224+
225+
The program applies the `@PathParameter` annotation to a `String` variable, which gets
226+
rendered by the GUI as an image-picker button. Note the allowed file `extensions`.
205227

228+
This mechanism only updates the `String` containing the path of an image file.
229+
230+
The `watchingImagePath()` delegate property is used to automatically load an image
231+
when its `String` argument changes.
206232

207233
![DemoPath01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoPath01Kt.png)
208234

209235
[source code](src/demo/kotlin/DemoPath01.kt)
210236

211237
### DemoPresets01
212238

213-
Shows how to store and retrieve in-memory gui presets.
239+
Shows how to store and retrieve in-memory GUI presets,
240+
each containing two integer values and two colors.
241+
214242
Keyboard controls:
215-
[Left Shift] + [0]..[9] => store current gui values to a preset
243+
[Left Shift] + [0]..[9] => store current GUI values to a preset
216244
[0]..[9] => recall a preset
217245

218246
![DemoPresets01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoPresets01Kt.png)
@@ -221,22 +249,44 @@ Keyboard controls:
221249

222250
### DemoSideCanvas01
223251

224-
A simple demonstration of a GUI for drawing some circles
252+
Demonstrates the `GUI.enableSideCanvas` feature.
253+
254+
When set to true, the `GUI` provides a `canvas` property where one can draw.
255+
The size of this canvas is the window size minus the GUI size.
256+
257+
That's why if we draw a circle at `drawer.width / 2.0` it is centered
258+
on the `canvas`, not on the window.
259+
260+
This demo sets the window to resizable, so if you resize the window
261+
you should see tha the circle stays at the center of the canvas.
262+
225263

226264
![DemoSideCanvas01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoSideCanvas01Kt.png)
227265

228266
[source code](src/demo/kotlin/DemoSideCanvas01.kt)
229267

230268
### DemoSimple01
231269

232-
A simple demonstration of a GUI for drawing some circles
270+
Demonstrates how to create a simple GUI with 4 inputs:
271+
- A `ColorParameter` which creates a color picker.
272+
- A `DoubleParameter` to control the radius of a circle.
273+
- A `Vector2Parameter` to set the position of that circle.
274+
- A `DoubleListParameter` which sets the radii of six circles.
275+
276+
The demo also shows how to use the variables controlled by the GUI
277+
inside the program, so changes to those variables affect
278+
the rendering in real time.
233279

234280
![DemoSimple01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoSimple01Kt.png)
235281

236282
[source code](src/demo/kotlin/DemoSimple01.kt)
237283

238284
### DemoXYParameter
239285

286+
Demonstrates the use of the `@XYParameter` annotation applied to a `Vector2` variable.
287+
288+
This annotation creates an interactive XY control in a GUI that can be used to update
289+
a `Vector2` variable. In this demo it sets the position of a circle.
240290

241291

242292
![DemoXYParameterKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoXYParameterKt.png)

orx-jvm/orx-rabbit-control/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,39 @@ More info about the web client:
4242
## Demos
4343
### DemoRabbitControl
4444

45+
Demonstrates how to use RabbitControl to create a web-based user interface for your program.
4546

47+
A `settings` object is created using the same syntax used for `orx-gui`, including
48+
annotations for different variable types.
49+
50+
The program then passes these `settings` to the `RabbitControlServer`. A QR-code is displayed
51+
to open the web user interface. A clickable URL is also displayed in the console.
52+
53+
Once the UI is visible in a web browser we can use it to control the OPENRNDR program.
4654

4755
![DemoRabbitControlKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-rabbit-control/images/DemoRabbitControlKt.png)
4856

4957
[source code](src/demo/kotlin/DemoRabbitControl.kt)
5058

5159
### DemoRabbitControlManualOverlay
5260

61+
Demonstrates how the QR-code pointing at the Rabbit Control web-based user interface
62+
can be displayed and hidden manually.
5363

64+
To display the QR-code overlay in this demo, hold down the HOME key in the keyboard.
5465

5566
![DemoRabbitControlManualOverlayKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-rabbit-control/images/DemoRabbitControlManualOverlayKt.png)
5667

5768
[source code](src/demo/kotlin/DemoRabbitControlManualOverlay.kt)
5869

5970
### DemoRabbitHole
6071

72+
Starts the RabbitControlServer with a `Rabbithole` using the key 'orxtest'.
73+
74+
`Rabbithole` allows you to access your exposed parameters from Internet
75+
connected computers that are not in the same network.
76+
77+
To use it with this example use 'orxtest' as the tunnel-name in https://rabbithole.rabbitcontrol.cc
6178

6279

6380
![DemoRabbitHoleKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-rabbit-control/images/DemoRabbitHoleKt.png)

0 commit comments

Comments
 (0)