Skip to content

Commit

Permalink
small update to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Aug 26, 2024
1 parent 283855b commit a28f68a
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 11 deletions.
23 changes: 23 additions & 0 deletions docs/animations.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,26 @@ cube rotate faster:

You could decouple the rotation from the frame rate by incrementing the rotation
depending on how much time has passed since the last call.


## What next?

<div class="grid cards" markdown>

- :material-cube:{ .lg .middle } __Objects__

---

Check out the guide on different object types.

[:octicons-arrow-right-24: Adding Objects](objects.md)

- :material-camera-control:{ .lg .middle } __Control__

---

Learn how to control the viewer, adjust colors, etc.

[:octicons-arrow-right-24: Controls](controls.md)

</div>
25 changes: 24 additions & 1 deletion docs/controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,27 @@ To activate them you can either press the `c` hotkey or:
>>> v.show_controls()
```

<center><img src="https://schlegelp.github.io/octarine/_static/jupyter_toolbar.png" alt="jupyter toolbar" width="75%"/></center>
<center><img src="https://schlegelp.github.io/octarine/_static/jupyter_toolbar.png" alt="jupyter toolbar" width="75%"/></center>


## What next?

<div class="grid cards" markdown>

- :material-cube:{ .lg .middle } __Objects__

---

Check out the guide on different object types.

[:octicons-arrow-right-24: Adding Objects](objects.md)

- :material-format-font:{ .lg .middle } __Animations__

---

Add movement to the viewer.

[:octicons-arrow-right-24: Animations](animations.md)

</div>
23 changes: 13 additions & 10 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,33 @@ cube = gfx.Mesh(

# Add to viewer
v.add(cube)

# This will show the viewer this cell
v.show()
```

!!! important

The `.show()` method generates and returns a widget wrapping the `Viewer`. In order for it to be displayed
this _has_ to be on the last line of the cell. The only other alternative is this:
In Jupyter, the `.show()` method generates and displays a widget wrapping the `Viewer`. In a script/terminal,
the `.show()` message will cause the window to appear. By default, the viewer is displayed right away but you
can decide to belay that like so:

```python
from IPython.display import display
display(v.show()) # display the widget
v = oc.Viewer(show=False) # set show=False when initializing the viewer
...
do other stuff
do stuff
```

Then in another cell:

```python
v.show()
```

![cube example](_static/cube_example_jupyter.png)

!!! tip "Resizing the widget"

You can adjust the size of the widget either when creating the viewer via
the `height` and `width` arguments, or afterwards by clicking + dragging the
lower right corner of the widget.
the `size` argument, or afterwards by clicking + dragging the lower right corner of
the widget.

### Sidecar

Expand Down
21 changes: 21 additions & 0 deletions docs/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,24 @@ by `Octarine`?

Go check out the [Extending Octarine](extending.md) tutorial to learn how!

## What next?

<div class="grid cards" markdown>

- :material-format-font:{ .lg .middle } __Animations__

---

Add movement to the viewer.

[:octicons-arrow-right-24: Animations](animations.md)

- :material-camera-control:{ .lg .middle } __Control__

---

Learn how to control the viewer, adjust colors, etc.

[:octicons-arrow-right-24: Controls](controls.md)

</div>

0 comments on commit a28f68a

Please sign in to comment.