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 / saypitch
Last active March 23, 2017 09:57
genarate mac voice
#!/bin/sh
## brew install sox
# example:~/saypitch "こんにちは" 240
TMP=/tmp/saypitch.aiff
if test $2 ; then
PITCH=$2
else
PITCH=0
@the6th
the6th / Garden.shader
Last active March 28, 2017 07:43
作り途中
Shader "Test/ClipHeight"
{
Properties
{
_MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
_MinY("MinYpos Height", float) = 0
_MaxY("MinYpos Height", float) = 100
_Radius("Radius",float) = 3
_CenterX("CenterX",float) = 0
_CenterZ("CenterZ",float) = 0
using UnityEngine;
using System.Collections;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class OpMeshGenerator : MonoBehaviour
{
public int divisionX = 200;
@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 {
@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 / 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 / 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 / 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 / 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 / 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