This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #version 150 | |
| uniform float time; | |
| uniform vec2 resolution; | |
| uniform vec2 mouse; | |
| uniform vec3 spectrum; | |
| uniform sampler2D midi; | |
| in VertexData |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // i copied and pasted these functions from the sticker sheet | |
| // to read more about turbo: https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html | |
| // in short, its good for colorblindness, getting more deatil (based on human perception), high contrast | |
| // but still smooth interpretation of the in-value | |
| vec3 turboPalette(float x){ // t can be any floating point number that changes, like time or pos.x; | |
| float m = 1.0; // it repeats every 1 unit, because thats the turbo function's range | |
| float t = m - abs(mod(x*20. , (2.*m)) - m); | |
| // this line turns an increasing value into a triangle wave, linear interpolation of length 1 up | |
| // linear interpolation of length 1 down. like this: /\/\/\/\/\/\/\/\/\/\/\/\/\/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <a-scene | |
| arjs="trackingMethod: best; sourceType: webcam; debugUIEnabled: false;" | |
| embedded | |
| renderer="logarithmicDepthBuffer: true;" | |
| vr-mode-ui="enabled: false" | |
| gesture-detector | |
| id="scene" | |
| > | |
| <a-nft | |
| type="nft" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| handleScale(event) { | |
| if (isMarkerVisible) { | |
| this.scaleFactor *= | |
| 1 + event.detail.spreadChange / event.detail.startSpread; | |
| this.scaleFactor = Math.min( | |
| Math.max(this.scaleFactor, this.data.minScale), | |
| this.data.maxScale | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| handleRotation(event) { | |
| if (isMarkerVisible) { | |
| el.object3D.rotation.y += | |
| event.detail.positionChange.x * rotationFactor; | |
| el.object3D.rotation.x += | |
| event.detail.positionChange.y * rotationFactor; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sceneEl.addEventListener("markerFound", (e) => { | |
| isMarkerVisible = true; | |
| }); | |
| sceneEl.addEventListener("markerLost", (e) => { | |
| isMarkerVisible = false; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <a-scene | |
| arjs | |
| embedded | |
| renderer="logarithmicDepthBuffer: true;" | |
| vr-mode-ui="enabled: false" | |
| gesture-detector | |
| id="scene" | |
| > | |
| // Scene stuff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://www.iquilezles.org/www/articles/palettes/palettes.htm | |
| // As t runs from 0 to 1 (our normalized palette index or domain), | |
| //the cosine oscilates c times with a phase of d. | |
| //The result is scaled and biased by a and b to meet the desired constrast and brightness. | |
| vec3 cosPalette( float t, vec3 a, vec3 b, vec3 c, vec3 d ) | |
| { | |
| return a + b*cos( 6.28318*(c*t+d) ); | |
| } | |
| float sphere(vec3 pos, float rad){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset='utf-8'> | |
| <meta http-equiv='X-UA-Compatible' content='IE=edge'> | |
| <title>GeoAR.js demo</title> | |
| <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1c2407b26c61958baa93967b5412487cd94b290b/dist/aframe-master.min.js"></script> | |
| <script src="https://unpkg.com/aframe-look-at-component@0.8.0/dist/aframe-look-at-component.min.js"></script> | |
| <script src='https://raw.githack.com/jeromeetienne/AR.js/2.1.4/aframe/build/aframe-ar.js'></script> | |
| <script> |