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 / 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 / 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 / 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)