Skip to content

Instantly share code, notes, and snippets.

View GOROman's full-sized avatar
👽
Damn I'm looking good.

GOROman GOROman

👽
Damn I'm looking good.
View GitHub Profile
@GOROman
GOROman / WebCam.cs
Last active July 3, 2021 01:22
UnityでWeb Cameraをテクスチャにアサインし、そのテクスチャをPNGでセーブする例
using UnityEngine;
using System.Collections;
using System.IO;
public class WebCam : MonoBehaviour {
public int Width = 1280;
public int Height = 720;
public int FPS = 15;
public Material material;
@GOROman
GOROman / EyeJitter.cs
Last active September 10, 2024 07:36
Unityで微細眼球運動っぽい何か
using UnityEngine;
using System.Collections;
public class EyeJitter : MonoBehaviour {
float timer = 0.0f;
Quaternion rot;
public float changeTime = 0.4f; // 変更する時間最小値
@GOROman
GOROman / DataRecoderWAV.rb
Last active July 2, 2018 05:39
なつかしのデータレコーダ(カセット)のピーーーーギャーーー音をつくる
#! ruby -Ks
# -*- mode:ruby; coding:shift_jis -*-
# 2400ボーのデータレコーダっぽいWAVをつくる
# 出力ファイル
FILENAME = "test.wav"
BAUD = 2400
CHANNELS = 1 # チャンネル
@GOROman
GOROman / id_rsa.pub
Created August 26, 2017 07:01
GOROman's Public Key
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv+5cPJxLUxpxsr/zey2N
19OqJJ44G1IpJ07K7odu9gjrDuXlr35vlOGl7DUIdVLCuwKmJ+5aeJHcIx8W5UMo
zNWAk1uGCt+UeF8yf2Vjm7zsYgp70cztnPB7F/CkSm+bHYDT8oBs+lhs/E06EnEX
00pLLWkmeUUaLtFDKlljzdgv5963iF4JoWhq0Y47TwHEBZ/+COKIZDMWKEb4FzPX
J7BHiIYocLalaDqth5X43RUHu5fZU1qmWGKjG9193A0aPrr+7jIPEm4TZukMJcvd
DvH5Vw1SiNa/2zo2zCTcxuAw4d8SNoTCM4g/HCTUTDiSi9BE9x58K92YYed1w2+T
bQIDAQAB
-----END PUBLIC KEY-----
@GOROman
GOROman / GOROmanLookAt.cs
Created September 10, 2017 05:12
GOROman's Look At Test
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GOROmanLookAt : MonoBehaviour {
public Transform target; // ターゲット位置
public Transform upVectorTarget; // アップベクター用のターゲット位置
public float swivelAngle = 0.0f; // あとからクルクルする用の回転角
public bool buildInLookAt = true; // 内蔵のLookAtを使うか?
@GOROman
GOROman / theta_v.rb
Created September 18, 2017 09:10
Ruby で THETA Vを制御したいのだけどコケるので死にたい
#RICOH THETA V を制御したいけどコケる
require 'net/http'
require 'json'
require 'pp'
HOST = '192.168.1.1' # THETA VのWIFI接続時のアドレス
PORT = 80 # THETA Vの制御ポート
http = Net::HTTP.new(HOST, PORT)
@GOROman
GOROman / SceneReloader.cs
Last active October 7, 2017 13:02
VR展示とかで便利なシーンをキーボードのキーでリロードする
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneReloader : MonoBehaviour {
public KeyCode reloadKey = KeyCode.Tab; // このキーを押すとシーンリロードする
public int reloadScene = 0; // リロード時のシーン番号
void Update () {
@GOROman
GOROman / RenderScaleController.cs
Last active October 7, 2017 13:35
[VR] Unity 2017.2系でレンダースケールを変える方法
using UnityEngine;
public class RenderScaleController : MonoBehaviour {
public float renderScale = 2.0f; // デフォルトは1.0 上げれば上げるほどVR内の解像度が高くなる(その分描画は重くなる)
// 起動時に一回だけ設定(動的に変えると描画が壊れる時がある)
void Start () {
UnityEngine.XR.XRSettings.eyeTextureResolutionScale = renderScale;
}
}
@GOROman
GOROman / VRRecenter.cs
Created October 7, 2017 13:42
[VR] Unityでカメラのリセンター処理
using UnityEngine;
public class VRRecenter : MonoBehaviour {
public KeyCode reloadKey = KeyCode.R; // このキーを押すとVR内のカメラ位置をリセンターする
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(reloadKey))
@GOROman
GOROman / OVOLEDLiveTest.cpp
Last active April 19, 2019 14:06
OVO LED Live control sample code for Windows
//
// OVO LED Live control sample code for Windows
//
// 要OVO Firmwareバージョン7以降
// https://www.jdsound.co.jp/products/ovo/manual/ovo_user_manual.pdf
#include <Windows.h>
#include <stdio.h>
#include <string.h>