Skip to content

Commit

Permalink
Improved controls and fixed resize issue; added controls in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyu committed Sep 16, 2022
1 parent 633a9c8 commit a7a9b8b
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 47 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ You can also add meshes, points, lines (see docs).
Note that each object e.g. cube, mesh, points, etc. must have a unique name to identify it
right now. You may programmatically generate this. They will show up in the *layers* pane
(top right of the html viewer)
**New in 0.0.6: Use / in the name e.g. cubes/red/cube001 to put meshes into folders in the layers pane.**


Please also `pip install torch svox tqdm scipy` for adding NeRF (`set_nerf`)
Expand All @@ -162,6 +161,13 @@ or `pip install trimesh` for using `add_mesh_from_file(path)`.
To add cameras (also used for scaling scene, initializing camera etc), use
`add_camera_frustum(focal_length=.., image_width=.., image_height=.., z=.., r=.., t=..)`

## Viewer Controls

- Left click and drag to orbit
- Right click and drag, or CTRL+left click and drag to pan
- Mouse wheel, middle click and drag, or ALT+left click and drag to zoom; alternatively use =/SHIFT+=
- Number keys 1-6 to change coordinate systems: Z up/down Y up/down X up/down resp.


## Source of pre-compiled binaries

Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: f5837c2a5854208224f4896b204b80a2
config: 335ad655ee6db75faddaf3fc265c4b94
tags: 645f666f9bcd5a90fca523b33c5a78b7
10 changes: 9 additions & 1 deletion docs/build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Scene: holds objects. If you only use one scene, feel free to use :code:`from ne

Names separated by :code:`/` will be collapsed into a tree in the layers panel in the output.


Other common functions include `add_camera_frustum`, `add_mesh`, `add_line`, `add_lines`,
`add_image`

Expand All @@ -44,3 +43,12 @@ Please see :ref:`nerfvis` for details.

nerfvis


Viewer controls
====================

* Left click and drag to orbit
* Right click and drag, or :code:`CTRL+left` click and drag to pan
* Mouse wheel, middle click and drag, or :code:`ALT+left` click and drag to zoom; alternatively use :code:`=`/:code:`SHIFT` + :code:`=`
* Number keys 1-6 to change coordinate systems: Z up/down Y up/down X up/down resp.

2 changes: 1 addition & 1 deletion docs/build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.1.0',
VERSION: '0.1.4',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &mdash; nerfvis 0.1.0 documentation</title>
<title>Index &mdash; nerfvis 0.1.4 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand Down
11 changes: 10 additions & 1 deletion docs/build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Welcome to nerfvis’s documentation! &mdash; nerfvis 0.1.0 documentation</title>
<title>Welcome to nerfvis’s documentation! &mdash; nerfvis 0.1.4 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand Down Expand Up @@ -97,6 +97,15 @@ <h1>Welcome to nerfvis’s documentation!<a class="headerlink" href="#welcome-to
<li class="toctree-l1"><a class="reference internal" href="nerfvis.html">Reference</a></li>
</ul>
</div>
</section>
<section id="viewer-controls">
<h1>Viewer controls<a class="headerlink" href="#viewer-controls" title="Permalink to this heading"></a></h1>
<ul class="simple">
<li><p>Left click and drag to orbit</p></li>
<li><p>Right click and drag, or <code class="code docutils literal notranslate"><span class="pre">CTRL+left</span></code> click and drag to pan</p></li>
<li><p>Mouse wheel, middle click and drag, or <code class="code docutils literal notranslate"><span class="pre">ALT+left</span></code> click and drag to zoom; alternatively use <code class="code docutils literal notranslate"><span class="pre">=</span></code>/<code class="code docutils literal notranslate"><span class="pre">SHIFT</span></code> + <code class="code docutils literal notranslate"><span class="pre">=</span></code></p></li>
<li><p>Number keys 1-6 to change coordinate systems: Z up/down Y up/down X up/down resp.</p></li>
</ul>
</section>


Expand Down
84 changes: 57 additions & 27 deletions docs/build/html/nerfvis.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/build/html/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Search &mdash; nerfvis 0.1.0 documentation</title>
<title>Search &mdash; nerfvis 0.1.4 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />

Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/searchindex.js

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Scene: holds objects. If you only use one scene, feel free to use :code:`from ne

Names separated by :code:`/` will be collapsed into a tree in the layers panel in the output.


Other common functions include `add_camera_frustum`, `add_mesh`, `add_line`, `add_lines`,
`add_image`

Expand All @@ -44,3 +43,12 @@ Please see :ref:`nerfvis` for details.

nerfvis


Viewer controls
====================

* Left click and drag to orbit
* Right click and drag, or :code:`CTRL+left` click and drag to pan
* Mouse wheel, middle click and drag, or :code:`ALT+left` click and drag to zoom; alternatively use :code:`=`/:code:`SHIFT` + :code:`=`
* Number keys 1-6 to change coordinate systems: Z up/down Y up/down X up/down resp.

19 changes: 15 additions & 4 deletions nerfvis/index.html

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions nerfvis/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ def write(self, path : str, compress : bool = True):
"""
Write to drawlist npz which you can open with volrend
(:code:`volrend --draw <output.npz>`;
nerfvis_base branch recommended for more up-to-date experience)
nerfvis_base branch recommended for more up-to-date experience)
as well as in the web viewer. Usually, it's easier to use one of
:code:`Scene.export()`,
:code:`Scene.display()`, or
Expand Down Expand Up @@ -1304,14 +1304,11 @@ def embed(self,
randstr = ''.join(
random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
embed_name = "ipython_embed_" + randstr + ".html"
# Make height > 100 slightly to keep scroll inside the iframe
# kind of trippy, but otherwise when using scroll wheel to zoom it
# starts scrolling the notebook..
css_inject = "#main-wrapper {max-height:101vh}"
# css_inject = "#main-wrapper {max-height:101vh}"
self.export(
dirname,
*args, display=False, open_browser=False,
css=css_inject,
# css=css_inject,
serve_nonblocking=False, embed_output=True,
output_html_name=embed_name,
**kwargs)
Expand Down
2 changes: 1 addition & 1 deletion nerfvis/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.3'
__version__ = '0.1.4'

0 comments on commit a7a9b8b

Please sign in to comment.