This file contains 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
// 指定したIDのGamepadを探す | |
function findGamepad(id) | |
{ | |
var gamepads = navigator.getGamepads(); | |
for (var i = 0, j = 0; i < 4; i++) | |
{ | |
// 取得したゲームパッドの中から「OpenVR Gamepad」を探す | |
var gamepad = gamepads[i]; | |
if (gamepad && gamepad.id === 'OpenVR Gamepad') | |
{ |
This file contains 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
(p - p_0) \cdot n < 0 ... 裏 \\ | |
(p - p_0) \cdot n > 0 ... 表 \\ | |
(p - p_0) \cdot n = 0 ... 平面上 |
This file contains 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
var initialized = false; | |
var camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.1, 100); | |
camera.position.y = 2; | |
camera.position.z = 2; | |
camera.lookAt(new THREE.Vector3(0, 0, 0)); | |
var renderer = new THREE.WebGLRenderer(); | |
renderer.setClearColor(0x101010); | |
renderer.setPixelRatio(window.devicePixelRatio); |
This file contains 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
(function (ns) { | |
'use strict'; | |
var camera, scene, renderer, light, ambientLight, | |
player, effect, controls, backBtn; | |
var sphere360view1, sphere360view2, sphere360view3; | |
/** |
This file contains 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
(function (ns) { | |
'use strict'; | |
var camera, scene, renderer, light, ambientLight, | |
player, effect, controls, backBtn; | |
var sphere360view1, sphere360view2, sphere360view3; | |
/** |
This file contains 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
function nearPow2(n) { | |
// 0以下の場合は常に0を返す | |
if (n <= 0) { | |
return 0; | |
} | |
var k = Math.ceil(Math.log2(n)); | |
return Math.pow(2.0, k); | |
} |
This file contains 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
uniform sampler2D texture; | |
uniform sampler2D blurTexture; | |
uniform sampler2D maskTexture; | |
varying vec2 vUV; | |
void main() { | |
float mask = texture2D(maskTexture, vUV).r; | |
if (mask > 0.0) { | |
gl_FragColor = texture2D(texture, vUV); | |
} |
This file contains 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
using UnityEngine; | |
using System.Collections; | |
using Leap; | |
using Leap.Unity; | |
using System.Collections.Generic; | |
public class AnyHand : MonoBehaviour { | |
[SerializeField] | |
GameObject m_ProviderObject; |
This file contains 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
// メソッド名がかぶって誤動作しないようにプロトコルにする | |
@protocol AnyEvent <NSObject> | |
@optional | |
- (void)tappedButton1:(id)responder; | |
- (void)tappedButton2:(id)responder; | |
@end | |
////////////////////////////////////////////////// |
This file contains 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
fixed a = Luminance(tex2D(_DissolveTex, i.dissolvecoord).xyz); | |
if (_CutOff > a) { | |
discard; | |
} |