Skip to content

Commit 9017b7d

Browse files
committed
2 parents 3a56854 + 6f5108d commit 9017b7d

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,84 @@ have an idea how to use existing creators and implement your own custom ones.
340340

341341
See also: [Mesh Creators](documentation/documentation.md)
342342

343+
## Workspace
344+
345+
The workspace serves as a simple mesh viewer, providing a convenient way to
346+
visualize and inspect 3D models. It offers basic functionalities without aiming to be
347+
a full-fledged modeling software. Currently, its sole purpose is to support the work
348+
with the mesh library.
349+
350+
In its current version, the viewer is tightly coupled to the Processing environment,
351+
which is used as the rendering pipeline. The workspace exists within a PApplet and
352+
requires a reference to this PApplet to function.
353+
354+
A simple template could look like this:
355+
356+
```java
357+
import mesh.Mesh3D;
358+
import mesh.creator.primitives.CubeCreator;
359+
import processing.core.PApplet;
360+
import workspace.Workspace;
361+
362+
public class WorkspaceTemplate extends PApplet {
363+
364+
public static void main(String[] args) {
365+
PApplet.main(WorkspaceTemplate .class.getName());
366+
}
367+
368+
Mesh3D mesh;
369+
370+
Workspace workspace;
371+
372+
@Override
373+
public void settings() {
374+
size(1000, 1000, P3D);
375+
smooth(8);
376+
}
377+
378+
@Override
379+
public void setup() {
380+
workspace = new Workspace(this);
381+
workspace.setGridVisible(true);
382+
workspace.setUiVisible(true);
383+
createMesh();
384+
}
385+
386+
@Override
387+
public void draw() {
388+
workspace.draw(mesh);
389+
}
390+
391+
public void createMesh() {
392+
CubeCreator creator = new CubeCreator();
393+
mesh = creator.create();
394+
}
395+
396+
}
397+
```
398+
399+
The workspace provides the following features:
400+
401+
**Camera movement:**
402+
403+
* Zoom with the mouse wheel,
404+
* rotate by dragging with the middle mouse button,
405+
* pan by dragging with the middle mouse button and holding down the Shift key,
406+
* navigate in first-person mode using WASD keys.
407+
408+
**Scene manipulation:**
409+
410+
* Reset camera position (C),
411+
* toggle UI visibility (Y),
412+
* toggle grid visibility (G),
413+
* show/hide face and vertex normals (N, V),
414+
* switch between wireframe and solid view (Z),
415+
* show/hide axes (1, 2, 3),
416+
* show/hide edges (E),
417+
* toggle smooth and flat shading (S),
418+
* switch to first-person mode and back (4),
419+
* toggle the rendering loop via the UI.
420+
343421
## Planed features
344422

345423
- Convex Hull

0 commit comments

Comments
 (0)