Skip to content

Instantly share code, notes, and snippets.

View the6th's full-sized avatar

HAYASHI Tomoki the6th

  • Nagoya,Japan
View GitHub Profile
@the6th
the6th / CircumcentreSolver.cs
Created September 16, 2018 05:32
4点と面する球の中心と半径を求める Unity/C#
/// <summary>
/// Given four points in 3D space, solves for a sphere such that all four points
/// lie on the sphere's surface.
/// </summary>
/// <remarks>
/// Translated from Javascript on http://www.convertalot.com/sphere_solver.html, originally
/// linked to by http://stackoverflow.com/questions/13600739/calculate-centre-of-sphere-whose-surface-contains-4-points-c.
/// </remarks>
public class CircumcentreSolver
@the6th
the6th / GvrControllerSwipeInput.cs
Created September 15, 2018 03:41
Detect Swipe event on Mirage Solo(Daytream) /Unity C# |Mirage SoloのコントローラーでSwipeイベントを取得する
using System;
using UnityEngine;
//@see https://github.com/zabaglione/DetectSwipe_SteamVR/blob/master/Assets/DetectSwipe_SteamVR/Scripts/ViveController.cs
//@see https://qiita.com/mo4_9/items/ac6d1ef0456d6fa0388d
public class GvrControllerSwipeInput : MonoBehaviour
{
public enum SwipeDirection
@the6th
the6th / GetBallFrom4Points.cs
Last active September 16, 2018 05:33
4点を内包する最小の球の中心と半径を求める C#/Unity
using UnityEngine;
/// <summary>
/// 4点を通る最小の球の中心と半径を求める C#
/// @see http://marupeke296.com/COL_3D_No22_BoundingSphere.html
/// </summary>
public static class ToolUtil
{
public static bool GetBallFrom4Points(Vector3[] pos, out Vector3 outP, out float outR)
@the6th
the6th / Cube.cs
Created August 1, 2018 09:12
Tap interaction in Mixed reality remotiong.
// related to https://www.youtube.com/watch?v=B7OByAvRCBE&lc=z22qfpiaxt22yzyrs04t1aokgykflkwea0fdhgkvaoxzbk0h00410
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HoloToolkit.Unity.InputModule;
public class Cube : MonoBehaviour, IInputClickHandler, IInputHandler
{
Material material;
@the6th
the6th / RemotingExample.cs
Last active June 10, 2018 02:11
Create enhanced 3D visuals with Holographic Remoting in UWP http://littlewing.hatenablog.com/entry/2018/06/09/212947
// Unity 2018.2.b7
//
// Create enhanced 3D visuals with Holographic Remoting in UWP:
// https://blogs.unity3d.com/jp/2018/05/30/create-enhanced-3d-visuals-with-holographic-emulation-in-uwp/
//
// my blog:
// http://littlewing.hatenablog.com/entry/2018/06/09/212947
using System.Collections;
using System.Collections.Generic;
@the6th
the6th / clock.py
Last active July 19, 2020 15:25
Digital Clock on M5stack JST
# https://github.com/m5stack/M5Cloud/blob/master/examples/DigitalClock/clock.py
# The default timezone on M5stack is CST(+8,China)
# change timezone to JST(+9)
from m5stack import *
import time, _thread, machine
def clock():
rtc = machine.RTC()
@the6th
the6th / calibration.cpp
Created January 9, 2018 07:35
VS2015 + opencv-2.4.13.5で calibration.cpp をbuildする。
#include "opencv2/opencv_lib.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <cctype>
#include <stdio.h>
#include <string.h>
#include <time.h>
@the6th
the6th / HoloLensDevicePortalAccessWithCurl.php
Created August 9, 2017 08:28
HoloLens DevicePortalAccess PHP ver
<?php
/**
* HoloLens Device Portal のRestAPI接続テスト PHP版
*
* @see API Reference https://developer.microsoft.com/en-us/windows/mixed-reality/device_portal_api_reference
*
*/
//HoloLensIP
@the6th
the6th / XboxPadTest.cs
Created June 7, 2017 07:02
test script for Xbox BluetoothController on Unity/UWP/HoloLens. it is draft
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if WINDOWS_UWP
using Windows.Gaming.Input;
#endif
public class XboxPadTest : MonoBehaviour {
using UnityEngine;
using System.Collections;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class OpMeshGenerator : MonoBehaviour
{
public int divisionX = 200;