From 7ad88da049f0f2653e304d095d0adfa6ccda50ee Mon Sep 17 00:00:00 2001 From: Abe Pazos Date: Sat, 15 Nov 2025 16:45:28 +0000 Subject: [PATCH] add demos to README.md --- orx-no-clear/README.md | 4 ++++ orx-obj-loader/README.md | 26 ++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/orx-no-clear/README.md b/orx-no-clear/README.md index a62c2ab6..10e8b8b6 100644 --- a/orx-no-clear/README.md +++ b/orx-no-clear/README.md @@ -55,7 +55,11 @@ NB! any submitted _lambda expression_ must be valid within the `renderTarget` co ## Demos ### DemoNoClear +By default, OPENRNDR clears the canvas on each animation +frame. [NoClear] disables that behavior, letting you +draw on top of what you drew in previous animation frames. +That's the default in some other frameworks. ![DemoNoClearKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-no-clear/images/DemoNoClearKt.png) diff --git a/orx-obj-loader/README.md b/orx-obj-loader/README.md index 6c4441da..ac9c15bd 100644 --- a/orx-obj-loader/README.md +++ b/orx-obj-loader/README.md @@ -26,7 +26,9 @@ vertexBuffer.saveOBJ("my/path/exported.obj") ## Demos ### DemoObjCompoundRW01 - +This program loads an OBJ mesh as a CompoundMeshData and demonstrates +how to convert it to a OBJ String representation, then +draws the beginning of this String on the program window. ![DemoObjCompoundRW01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-obj-loader/images/DemoObjCompoundRW01Kt.png) @@ -34,6 +36,9 @@ vertexBuffer.saveOBJ("my/path/exported.obj") ### DemoObjLoader01 +Demonstrates how to load a `.obj` file as a `VertexBuffer`. + +The `loadOBJasVertexBuffer()` function expects the path to the `.obj` file as an argument. ![DemoObjLoader01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-obj-loader/images/DemoObjLoader01Kt.png) @@ -42,7 +47,10 @@ vertexBuffer.saveOBJ("my/path/exported.obj") ### DemoObjSaver01 +Demonstrates how to save a `VertexBuffer` as an `.obj` file using the +`VertexBuffer.saveOBJ()` method. +The program loads an existing OBJ file, then saves it with a new file name. ![DemoObjSaver01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-obj-loader/images/DemoObjSaver01Kt.png) @@ -50,6 +58,9 @@ vertexBuffer.saveOBJ("my/path/exported.obj") ### DemoObjSaver02 +Demonstrates saving a `VertexBuffer` generated via code as an OBJ file. + +This file can be loaded in a 3D modelling / rendering program. ![DemoObjSaver02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-obj-loader/images/DemoObjSaver02Kt.png) @@ -58,7 +69,18 @@ vertexBuffer.saveOBJ("my/path/exported.obj") ### DemoWireframe01 -Display wireframe and non-planar faces +Demonstrates two approaches for loading an OBJ file: as a `VertexBuffer` and as `CompoundMeshData`. + +A `CompoundMeshData` object contains vertices, texture coordinates, colors, normals, tangents, and bitangents, +alongside their associated face indices, grouped into meshes. + +In this demo `CompoundMeshData.wireframe()` is called to generate a wireframe representation of the loaded mesh. + +When rendering the wireframe, a shade style is used to displace the lines slightly towards the camera, to ensure +the lines do not end up occluded by the mesh rendered as triangles. + +Finally, the `sub` method is called on the `Path3D` instances to draw only parts of the wireframe, creating +an animated effect. ![DemoWireframe01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-obj-loader/images/DemoWireframe01Kt.png)