-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
add three scenes for link traversal #1575
Conversation
<a-entity id="sky" | ||
geometry="primitive: sphere; radius: 65;" | ||
material="shader: skyGradient; colorTop: #353449; colorBottom: #BC483E; side: back"></a-entity> | ||
<a-entity ground='url: https://media.aframe.io/link-traversal/models/groundSunrise.json'></a-entity> |
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.
why single ticket marks?
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.
a problem of having different conventions for different contexts. JS vs HTML
4bcf46b
to
599a838
Compare
src/components/link.js
Outdated
|
||
module.exports.Component = registerComponent('link', { | ||
schema: { | ||
url: { default: '' }, |
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.
Maybe href
to be consistent with the primitive that is abstracting it as with as with <a>
?
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.
yes, please
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.
or, rather can we call the component href
? I know it conflicts with the aframe-href-component
. another approach I thought about, in keeping with the behaviour of 2D/classic anchors: perhaps we could actually wrap the entities in <a>
elements. any emitted click
would bubble up to the <a>
and handle the page navigation (i.e., modifying window.location
from JS). thoughts?
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.
Wrapping in <a>
isn't great. It doesn't fit with the framework, is syntactically more complicated (both in HTML, and you can't just synchronously do setAttribute('link', ..>)
or use mixins/aframe-mss
/inspector), and will cause tons of complications in introducing a non-A-Frame element into the scene graph.
No strong preference for href/link, but href
might be confusing because people will be passing a URL string to it, when it needs both an href
and an event name (href="href: blah.com; on: grab
).
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.
I know A-Frame is entering (or reentering, heh) unchartered territory. FWIW, per the WHATWG's HTML Living Standard, the href
attribute is defined as such:
This implied hyperlink has no special meaning (it has no link type) beyond linking the element's document to the resource given by the element's
href
attribute.
Given that, perhaps it makes sense to leave the href
as just a pointer (i.e., URL) to a document (or target [i.e., hash] in the active document).
Also this:
A hyperlink can have one or more hyperlink annotations that modify the processing semantics of that hyperlink.
Given that, perhaps it makes sense to allow people to declaratively define event triggers using the rel
attribute (or custom logic using JS). A default behaviour might be to listen for the click
listener (or some default even of A-Frame's choosing).
Thoughts?
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.
link="href: foo.bar; on: hit"
is fine. Separate attribute/component isn't consistent with the framework, prescribing an event is inflexible to different use cases.
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.
Sorry, what I'm suggesting is to separate the attributes/components. Perhaps this is something worth asking developers in Slack, for example, of what feels/looks more intuitive/expected.
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.
I can say it's not intuitive nor consistent with A-Frame's design (i..e, separate attributes for related properties of a component).
At the primitive level, it can be done, which is what @dmarcos has already done. <a-link href="foo.bar" on="click">
.
can you rebase? |
as a developer, I like the idea of |
05bbec9
to
7134c55
Compare
a892c09
to
95da622
Compare
96d1e0b
to
63f3fba
Compare
ceb14cb
to
e16cb9e
Compare
Tests pending |
ddb9260
to
e0d06aa
Compare
* Tracked controls system. | ||
* It maintains a list with the available tracked controllers | ||
*/ | ||
module.exports.System = registerSystem('link', { |
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.
I don't think this needs to be a system, it doesn't provide any services to the link component. It can be part of the scene module, which is where all the other WebVR-related handlers live (e.g., onvrdisplaypresentchange
as well as enterVR/exitVR.
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.
It does. I should probably initialize the variable but the currently peeked link is referenced on the system
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.
That's fine to put any variables you need here, but the activate/deactivate event handlers belong on the scene module vs. links IMO, they're not link-specific.
@@ -0,0 +1,372 @@ | |||
/*eslint-disable */ |
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.
We can pull the 3rd party components in from unpkg.com
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.
I just did a parse initial pass, more nits than not. I'm trying to test it on Vive/Nightly, but not entering VR at the moment for me.
*/ | ||
module.exports.Component = registerComponent('link', { | ||
schema: { | ||
href: {default: ''}, |
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.
can sort these
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.
Hi
src/components/link.js
Outdated
color: {default: 'white', type: 'color'}, | ||
highlighted: {default: false}, | ||
highlightedColor: {default: '#24CAFF', type: 'color'}, | ||
visualAspectEnabled: {default: true}, |
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.
maybe portalMode
?
src/components/link.js
Outdated
init: function () { | ||
this.redirect = this.redirect.bind(this); | ||
this.previousQuaternion = undefined; | ||
this.hiddenEls = []; |
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.
Can comment what this does
src/components/link.js
Outdated
if (data.on !== oldData.on) { this.updateEventListener(); } | ||
if (data.peekMode !== oldData.peekMode) { this.updatePeekMode(); } | ||
if (!data.src || oldData.src === data.src) { return; } | ||
el.setAttribute('material', 'pano', data.src.src); |
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.
What happens if an inline URL is passed?
src/components/link.js
Outdated
href: {default: ''}, | ||
title: {default: ''}, | ||
on: {default: 'click'}, | ||
src: {type: 'asset'}, |
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.
I'd call this like image
to not confuse with href
and start moving away from the src
name
(holdover from the 2D web)
this.cameraPosition.setFromMatrixPosition(camera.matrixWorld); | ||
}, | ||
|
||
tick: function (time, delta) { |
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.
prefer to see the handlers first (top level) and then the helper methods
el.removeEventListener('trackpadtouchend', this.stopPeeking); | ||
break; | ||
default: | ||
console.warn('Uknown controller ' + this.controller + '. Cannot remove link event listeners.'); |
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.
typo
src/components/link.js
Outdated
thetaStart: 0, | ||
thetaLength: 360 | ||
}); | ||
|
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.
can remove a couple of these blank lines to group the entity modifications together
src/components/link.js
Outdated
|
||
/** | ||
* The tick handles: | ||
* 1. It swaps the plane the represents the portal with a sphere with a hole when the camera is close |
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.
Don't need to put It
behind anywhere since it's ambiguous and we can infer from context
src/components/link.js
Outdated
cameraPortalOrientation = this.calculateCameraPortalOrientation(); | ||
// If the user gets very close to the portal it is replaced | ||
// by a holed sphere where see can peek inside | ||
if (distance < 1.0) { |
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.
Can we do closer than 1 meter?
Alright, Nightly enters for me now. Camera had a low height for a bit until I restarted. But I experienced that the enter VR wasn't kicking in after navigation, and the portals are too large/far away (I can't walk up to them, and or poke my head thru because they look huge) |
Very cool. It works in nighlty, nightly actually started working again
after today's oculus upgrade. I noticed that if I start in sunrise.html the
labels for the Oculus controllers overlap.
Steve Luiting
http://sluiting.weebly.com
P: 720.563.9377
…On Mon, Jun 26, 2017 at 2:36 PM, Kevin Ngo ***@***.***> wrote:
Alright, Nightly enters for me now. Camera had a low height for a bit
until I restarted. But I experienced that the enter VR wasn't kicking in
after navigation, and the portals are too large/far away (I can't walk up
to them, and or poke my head thru because they look huge)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1575 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAXATnznpeLqzAXr9lSnLV3yiBnAHTp4ks5sIBZXgaJpZM4I8aW3>
.
|
In link-controls.js
This threw an error for me
|
Still looking into this, but creating the links programmatically with var LINKS = [
{href: '?env=arches', image: 'img/arches.png', title: 'Arches'},
{href: '?env=checkboard', image: 'img/checkerboard.png', title: 'Checkerboard'},
{href: '?env=egypt', image: 'img/egypt.png', title: 'Egypt'},
{href: '?env=forest', image: 'img/forest.png', title: 'Forest'},
{href: '?env=goaland', image: 'img/goaland.png', title: 'Goaland'},
{href: '?env=goldmine', image: 'img/goldmine.png', title: 'Goldmine'},
{href: '?env=japan', image: 'img/japan.png', title: 'Japan'},
{href: '?env=poison', image: 'img/poison.png', title: 'Poison'},
{href: '?env=threetowers', image: 'img/threetowers.png', title: 'Three Towers'},
{href: '?env=tron', image: 'img/tron.png', title: 'Tron'},
{href: '?env=yavapai', image: 'img/yavapai.png', title: 'Yavapai'},
];
AFRAME.registerComponent('generate-links', {
init: function () {
LINKS.forEach(link => {
var linkEl;
// Current page.
if (window.location.search.indexOf(link.href.substring(1)) !== -1) { return; }
linkEl = document.createElement('a-entity');
linkEl.setAttribute('link', {
href: link.href,
src: link.image,
title: link.title
});
this.el.appendChild(linkEl);
});
}
}); Gives errors like:
I debugged and found that |
I think an issue is Changed to |
It doesn't look like the portals are doing |
Should |
I think the title text above the portals need double-sided materials in case you go to the other side |
r+ |
Am I doing something wrong or maybe I don't get it, should we be able to "click" on them with mouse/trackpad? edit: similar to this BUT instead of hovering/waiting to load you can Tap/Click on them instead? https://aframe-gallery.glitch.me/ |
This is for VR to VR scene traversal. |
Description:
Creates a showcase to illustrate link traversal, characteristic of the WebVR 1.0 spec. A hover and click effects for the links are still pending.
@cvan I know you have opinions on how pages should handle link traversal while remaining in VR. Let's discus and incorporate those ideas into this PR.
This is a link to the demo if you want to quickly try it out:
http://swimminglessonsformodernlife.com/aframe/examples/showcase/link-traversal/