-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review #1
base: review
Are you sure you want to change the base?
Review #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
date: | ||
title: | ||
categories: | ||
description: | ||
type: Document | ||
--- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
title: Reality Tabs Overview | ||
description: Learn what reality tabs are from a high-level overview. | ||
categories: | ||
- development-guide | ||
type: Document | ||
set: development-guide | ||
set_order: 16 | ||
--- | ||
|
||
Reality Tabs are `xr-iframes` which are like `iframes` but will extra spatial attributes like `position`, `scale`, `orientation`. | ||
|
||
### iframe | ||
|
||
On the 2d web, an `iframe` is basically a window to another webpage, within a webpage. So you could be on a webpage and on that webpage there's an `<iframe>` that points to another webpage. | ||
|
||
Example: | ||
```html | ||
<html> | ||
<body> | ||
|
||
<iframe src="http://google.com" /> | ||
|
||
</body> | ||
</html> | ||
``` | ||
|
||
|
||
### Position | ||
|
||
Positioning an `iframe` on a 2d webpage only has 2 ways to move: up and down & left and right. In the 3d web, there is an additional `z` coordinate. | ||
|
||
`xr-iframe` has an additional `position` attirbute, which allows creators to set where the `xr-iframe` site is in virtual space. | ||
|
||
It looks something like this: | ||
`xrIframe.positon = [x, y, z]` | ||
|
||
### Orientation | ||
|
||
`xr-iframe` has an additional `orientation` attirbute, which allows creators to set the rotational direction of the site in virtual space. | ||
|
||
It looks something like this using threejs: | ||
`xrIframe.orientation = new THREE.Quaternion().setFromEuler(new THREE.Euler(1, 1, 1, 'YXZ')).toArray()` | ||
|
||
|
||
|
||
### Scale | ||
|
||
Defining the size and scale of an `xr-iframe` is as simple as defining the `scale` attribute in three numbers for `x`, `y`, and `z`. | ||
|
||
It looks something like this: | ||
`xrIframe.scale = [x, y, z]` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
title: xr-iframe API | ||
description: How to create and manipulate reality tabs. | ||
categories: | ||
- development-guide | ||
type: Document | ||
set: development-guide | ||
set_order: 21 | ||
--- | ||
|
||
This page will cover how to create and manipulate reality tabs (`xr-iframe`). | ||
|
||
## Top-level creation | ||
```js | ||
// Import exokit-web | ||
import('https://web.exokit.org/src/index.js')) | ||
chrislatorres marked this conversation as resolved.
Show resolved
Hide resolved
|
||
.then(() => { | ||
// Create xr-iframe, define src attribute, and append/place it wherever you want as if it was a normal canvas | ||
const xrIframe = document.createElement('xr-iframe'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should call this an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense conceptually, since it is possible to render multiple scenes in something like threejs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unlike three though, they would basically be completely separate. |
||
xrIframe.src = 'child.html'; | ||
document.body.appendChild(xrIframe); | ||
}); | ||
``` | ||
|
||
## xr-iframe manipulation | ||
|
||
```js | ||
// Set xr-iframe position | ||
xrIframe.position = [1, 1, 1]; | ||
chrislatorres marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Set xr-iframe orientation | ||
xrIframe.orientation = new THREE.Quaternion().setFromEuler(new THREE.Euler(1, 1, 1, 'YXZ')).toArray(); | ||
// Set xr-iframe scale | ||
xrIframe.scale = [1, 1, 1]; | ||
``` | ||
|
||
chrislatorres marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## Child xr-iframe creation | ||
|
||
```js | ||
// Create WebGL renderer and define layers | ||
const renderer = new THREE.WebGLRenderer({ | ||
antialias: true, | ||
}); | ||
document.body.appendChild(renderer.domElement); | ||
const layers = [renderer.domElement]; | ||
|
||
... | ||
|
||
// Request WebXR session and assign session layers | ||
const session = await navigator.xr.requestSession({ | ||
chrislatorres marked this conversation as resolved.
Show resolved
Hide resolved
|
||
exclusive: true, | ||
}); | ||
session.layers = layers; | ||
|
||
... | ||
|
||
// Create xr-iframe, define src attribute, and push to layers | ||
xrIframe = document.createElement('xr-iframe'); | ||
xrIframe.src = 'childschild.html'; | ||
layers.push(xrIframe); | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
date: 2018-01-01 | ||
title: FAQ | ||
redirect_from: | ||
- /docs/faq | ||
- /faq | ||
- /docs/frequently-asked-questions | ||
description: Frequently Asked Questions | ||
categories: | ||
- Exokit | ||
type: Document | ||
set: general | ||
set_order: 1 | ||
--- | ||
|
||
## How can I visit | ||
|
||
still under development |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
date: 2018-01-01 | ||
title: Introduction | ||
description: Exokit Engine | ||
redirect_from: | ||
- /introduction | ||
- /docs | ||
- /docs/ | ||
categories: | ||
- Exokit | ||
type: Document | ||
set: general | ||
set_order: 0 | ||
--- | ||
|
||
3d virtual space |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
date: 2018-01-01 | ||
title: Coding scenes | ||
description: This set will help you understand how things work in the SDK. | ||
redirect_from: | ||
- /documentation/introduction/ | ||
- /docs/sdk-overview/ | ||
- /docs/command-line-interface/ | ||
- /docs/sdk-quick-start-guide/ | ||
- /sdk-reference/introduction/ | ||
categories: | ||
- getting-started | ||
type: Document | ||
set: getting-started | ||
set_order: 3 | ||
--- | ||
|
||
## The development tools | ||
|
||
At a very high level, the SDK |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
date: 2018-01-01 | ||
title: Installation Guide | ||
description: Step-by-step guide to installing the SDK | ||
redirect_from: | ||
- /documentation/installation-guide/ | ||
categories: | ||
- getting-started | ||
type: Document | ||
set: getting-started | ||
set_order: 2 | ||
--- | ||
|
||
# Installation go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like:
A high quality video would be good here.