Skip to content

WIP: AR support#397

Draft
mariobuikhuizen wants to merge 13 commits into
widgetti:masterfrom
mariobuikhuizen:feat_ar_2
Draft

WIP: AR support#397
mariobuikhuizen wants to merge 13 commits into
widgetti:masterfrom
mariobuikhuizen:feat_ar_2

Conversation

@mariobuikhuizen

Copy link
Copy Markdown

No description provided.

@maartenbreddels maartenbreddels left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, however for some reason it seems the center of the box seems to be placed at the floor, I will check that out. 2 small changes requested.

Comment thread js/src/ar.js Outdated
renderer.xr.setSession(null);
lastXrTransform = null;
showCloseOverlay(false);
renderer.setAnimationLoop(() => null);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
renderer.setAnimationLoop(() => null);
renderer.setAnimationLoop(null);

Otherwise we still render continuous after stopping.

Comment thread js/src/figure.ts Outdated
});
}
this.arRootPositionBackup = this.model.get("box_center").concat();
this.model.set("box_center", [0.5, 0.5,-3]);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.model.set("box_center", [0.5, 0.5,-3]);
this.model.set("box_center", [0.5, 0.5, -3]);

@maartenbreddels

maartenbreddels commented Nov 4, 2021

Copy link
Copy Markdown
Collaborator

Sharing the demo:

ipyvolume-ar-scatter-no-audio.mp4

It seems also that the floor is moving wrt the scene btw.

@maartenbreddels

Copy link
Copy Markdown
Collaborator

To reproduce the klein bottle:

fig = ipv.figure()
ipv.examples.klein_bottle()
ipv.save("ar.html", devmode=True)

To make sure we pick up the right ipyvolume from this branch:

$ (cd js; npm run watch:dev) 
$ ln ~/src/ipyvolume/js/dist/index.js.map index.js.map 
$ ln ~/src/ipyvolume/js/dist/index.js ipyvolume.js
$ python -m ipyvolume.server

Open from your phone:: https:///ar.html (ignore the self signed certificate and continue)
click the AR button (only visible when your phone supports it).

@mariobuikhuizen can you share the link where all supported devices are listed?

@mariobuikhuizen

Copy link
Copy Markdown
Author

Supported devices: https://developers.google.com/ar/devices.

For iOS https://labs.mozilla.org/projects/webxr-viewer/ can be used.

@mariobuikhuizen

Copy link
Copy Markdown
Author

@maartenbreddels how can I get your example running? Where does the python code go?

@maartenbreddels

Copy link
Copy Markdown
Collaborator

just execute it from anywhere, in a script, or from the REPL, since we save it to HTML, no jupyter environment is needed.

@mariobuikhuizen

Copy link
Copy Markdown
Author

Ah, missed the saving to HTML.

@smith-kyle

Copy link
Copy Markdown

I'm a little late to the party, but I noticed you all aren't using a notebook review tool and wanted to invite you to review this pull request with GitNotebooks: https://gitnotebooks.com/widgetti/ipyvolume/pull/397

It lets you do things like comment on rendered markdown and code cells, so might be an easy win for your PR reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants