add demos to README.md
This commit is contained in:
@@ -55,7 +55,11 @@ NB! any submitted _lambda expression_ must be valid within the `renderTarget` co
|
|||||||
## Demos
|
## Demos
|
||||||
### DemoNoClear
|
### 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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ vertexBuffer.saveOBJ("my/path/exported.obj")
|
|||||||
## Demos
|
## Demos
|
||||||
### DemoObjCompoundRW01
|
### 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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -34,6 +36,9 @@ vertexBuffer.saveOBJ("my/path/exported.obj")
|
|||||||
|
|
||||||
### DemoObjLoader01
|
### DemoObjLoader01
|
||||||
|
|
||||||
|
Demonstrates how to load a `.obj` file as a `VertexBuffer`.
|
||||||
|
|
||||||
|
The `loadOBJasVertexBuffer()` function expects the path to the `.obj` file as an argument.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
@@ -42,7 +47,10 @@ vertexBuffer.saveOBJ("my/path/exported.obj")
|
|||||||
|
|
||||||
### DemoObjSaver01
|
### 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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -50,6 +58,9 @@ vertexBuffer.saveOBJ("my/path/exported.obj")
|
|||||||
|
|
||||||
### DemoObjSaver02
|
### DemoObjSaver02
|
||||||
|
|
||||||
|
Demonstrates saving a `VertexBuffer` generated via code as an OBJ file.
|
||||||
|
|
||||||
|
This file can be loaded in a 3D modelling / rendering program.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
@@ -58,7 +69,18 @@ vertexBuffer.saveOBJ("my/path/exported.obj")
|
|||||||
|
|
||||||
### DemoWireframe01
|
### 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.
|
||||||
|
|
||||||

|

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