All Projects â†’ stspanho â†’ aframe-hit-test

stspanho / aframe-hit-test

Licence: other
A-Frame hit-testing example

Programming Languages

HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to aframe-hit-test

lvr
👓 Augmented Reality for everyone - Out of the world experiences
Stars: ✭ 92 (+135.9%)
Mutual labels:  threejs, a-frame, augmented-reality
Threear
A marker based Augmented Reality library for Three.js
Stars: ✭ 124 (+217.95%)
Mutual labels:  threejs, augmented-reality, webxr
apate-ar
Framwork for environment aware AR with occlusion, lighting PBR rendering, physics support (cannon.js), based on three.js
Stars: ✭ 77 (+97.44%)
Mutual labels:  threejs, augmented-reality, webxr
WebScreenVR
WebScreenVR enhance your workspace while in Virtual Reality, allowing you to cast your screen and different applications around you in a 3D environment.
Stars: ✭ 53 (+35.9%)
Mutual labels:  a-frame, augmented-reality
Webxr Emulator Extension
WebXR emulator extension
Stars: ✭ 231 (+492.31%)
Mutual labels:  threejs, webxr
depth-sensing
Specification: https://immersive-web.github.io/depth-sensing/ Explainer: https://github.com/immersive-web/depth-sensing/blob/main/explainer.md
Stars: ✭ 47 (+20.51%)
Mutual labels:  augmented-reality, webxr
Studio
An authoring platform to build Web Augmented Reality experiences, without coding knowledge
Stars: ✭ 135 (+246.15%)
Mutual labels:  threejs, augmented-reality
MyOOS
MyOOS [Shop system] Repository
Stars: ✭ 26 (-33.33%)
Mutual labels:  augmented-reality, webxr
threelet
Portable 3D/WebXR component based on three.js
Stars: ✭ 38 (-2.56%)
Mutual labels:  threejs, webxr
vimeo-threejs-player
A plugin for streaming video from Vimeo to WebGL/VR/AR apps
Stars: ✭ 75 (+92.31%)
Mutual labels:  threejs, augmented-reality
DepthKit-A-Frame
đŸŽĨ An A-Frame component for rendering DepthKit volumetric videos in WebVR
Stars: ✭ 34 (-12.82%)
Mutual labels:  threejs, a-frame
Three.vrcontroller
Support hand controllers for Oculus, Vive, Windows Mixed Reality, Daydream, GearVR, and more by adding VRController to your existing Three.js-based WebVR project.
Stars: ✭ 213 (+446.15%)
Mutual labels:  threejs, webxr
Ar.js
Image tracking, Location Based AR, Marker tracking. All on the Web.
Stars: ✭ 3,048 (+7715.38%)
Mutual labels:  threejs, augmented-reality
Jeelizfacefilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: ✭ 2,042 (+5135.9%)
Mutual labels:  threejs, augmented-reality
ARFaceFilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: ✭ 72 (+84.62%)
Mutual labels:  threejs, augmented-reality
immersive-ar-emulation
A sort-of polyfill to emulate a fake AR environment which can be hit-tested against.
Stars: ✭ 26 (-33.33%)
Mutual labels:  threejs, webxr
spacesvr
A standardized reality for the future of the 3D Web.
Stars: ✭ 135 (+246.15%)
Mutual labels:  threejs, webxr
Remixvr
RemixVR is a tool for collaboratively building customisable VR experiences.
Stars: ✭ 129 (+230.77%)
Mutual labels:  threejs, webxr
app
Web metaverse client
Stars: ✭ 115 (+194.87%)
Mutual labels:  threejs, webxr
XREngine
Immersive infrastructure for everyone. Everything you need to build and deploy scalable realtime 3D social apps and more. 🤖 🚀 👓 🚀 🕹ī¸ 🚀 🧑đŸŋ‍🚀
Stars: ✭ 423 (+984.62%)
Mutual labels:  threejs, webxr

Update

It has been added by default in A-Frame. Check https://medium.com/samsung-internet-dev/use-new-augmented-reality-features-with-just-a-few-lines-of-code-with-webxr-and-aframe-c6f3f5789345

WebXR hit-testing example

In this example I've used the Spinosaurus example by Klaus Weidner (https://glitch.com/edit/undefined#!/xr-spinosaurus) and implemented a hit-testing component for A-Frame.

The component uses the new WebXR hit-testing feature. You can test this with an Android phone and a Chrome (Beta) v81+ browser.

You can read more about this feature here: https://immersive-web.github.io/hit-test/

(Note the example is without shadows, because I have some flickering issues.)

The component

AFRAME.registerComponent('ar-hit-test', {
			init: function () {
				this.xrHitTestSource = null;
				this.viewerSpace = null;
				this.refSpace = null;

				this.el.sceneEl.renderer.xr.addEventListener('sessionend', (ev) => {
					this.viewerSpace = null;
					this.refSpace = null;
					this.xrHitTestSource = null;
				});
				this.el.sceneEl.renderer.xr.addEventListener('sessionstart', (ev) => {
					let session = this.el.sceneEl.renderer.xr.getSession();

					let element = this.el;
					session.addEventListener('select', function () {
						let position = element.getAttribute('position');

						document.getElementById('dino').setAttribute('position', position);
						document.getElementById('light').setAttribute('position', {
							x: (position.x - 2),
							y: (position.y + 4),
							z: (position.z + 2)
						});
					});

					session.requestReferenceSpace('viewer').then((space) => {
						this.viewerSpace = space;
						session.requestHitTestSource({space: this.viewerSpace})
								.then((hitTestSource) => {
									this.xrHitTestSource = hitTestSource;
								});
					});

					session.requestReferenceSpace('local-floor').then((space) => {
						this.refSpace = space;
					});
				});
			},
			tick: function () {
				if (this.el.sceneEl.is('ar-mode')) {
					if (!this.viewerSpace) return;

					let frame = this.el.sceneEl.frame;
					let xrViewerPose = frame.getViewerPose(this.refSpace);

					if (this.xrHitTestSource && xrViewerPose) {
						let hitTestResults = frame.getHitTestResults(this.xrHitTestSource);
						if (hitTestResults.length > 0) {
							let pose = hitTestResults[0].getPose(this.refSpace);

							let inputMat = new THREE.Matrix4();
							inputMat.fromArray(pose.transform.matrix);

							let position = new THREE.Vector3();
							position.setFromMatrixPosition(inputMat);
							this.el.setAttribute('position', position);
						}
					}
				}
			}
		});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].