add demos to README.md

This commit is contained in:
Abe Pazos
2025-11-15 16:45:28 +00:00
parent b24586288d
commit 7ad88da049
2 changed files with 28 additions and 2 deletions

View File

@@ -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)

View File

@@ -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)