Skip to content

Instantly share code, notes, and snippets.

@ousttrue
ousttrue / vbo_sample.py
Last active May 19, 2022 15:27
PyOpenGL vbo sample
# coding: utf-8
# 20190825 rewrite
import sys
import array
import ctypes
import struct
from typing import Any
from OpenGL.GL import *
from OpenGL.GLUT import *
using UnityEngine;
using System.Collections;
#if UNITY_EDITOR
using UnityEditor;
#endif
[ExecuteInEditMode]
@ousttrue
ousttrue / FFMpegYUV4Texture.cs
Last active September 20, 2024 02:44
TextureUpdater for Unity by ffmpeg
using UnityEngine;
using System.IO;
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Collections;
public class FFMpegYUV4Texture : MonoBehaviour
{
@ousttrue
ousttrue / CameraGizmoDrawer.cs
Last active July 10, 2023 19:52
draw camera frustum
using UnityEngine;
[RequireComponent(typeof(Camera))]
public class CameraGizmoDrawer : MonoBehaviour
{
Camera m_camera;
void OnDrawGizmos()
{
if (m_camera == null)
@ousttrue
ousttrue / WorldCanvasHolder.cs
Created February 12, 2016 22:35
placeholder for worldspace canvas
using UnityEngine;
[RequireComponent(typeof(BoxCollider))]
public class CanvasPlaceHolder : MonoBehaviour {
[SerializeField]
RectTransform Target;
[SerializeField]
bool EnableGizmo = true;
@ousttrue
ousttrue / HumanTrait.MuscleName
Last active September 12, 2022 16:00
HumanTrait.MuscleName of Unity2017.3.0f3
[0]Spine Front-Back
[1]Spine Left-Right
[2]Spine Twist Left-Right
[3]Chest Front-Back
[4]Chest Left-Right
[5]Chest Twist Left-Right
[6]UpperChest Front-Back
[7]UpperChest Left-Right
[8]UpperChest Twist Left-Right
[9]Neck Nod Down-Up
@ousttrue
ousttrue / Retargetting.cs
Created December 29, 2015 05:27
Unity5.3 retargetting
using System;
using UnityEngine;
public class Retargetting : MonoBehaviour {
[SerializeField]
Retargetting Source;
Animator m_animator;
HumanPoseHandler m_handler;
@ousttrue
ousttrue / gulpfile.coffee
Last active December 6, 2015 05:14
mithril with typescript
# setup
#
# > npm init -y
# > npm install coffee-script gulp-load-plugins browser-sync sprintf -D
# > gulp init
gulp = require('gulp')
$ = require('gulp-load-plugins')()
browserSync = require('browser-sync').create()
fs = require('fs')
path = require('path')
@ousttrue
ousttrue / SingleThreadSynchronizationContext.cs
Created August 28, 2015 18:45
SynchronizationContext sample
using Reactive.Bindings;
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Threading;
using System.Windows.Input;
@ousttrue
ousttrue / ReacContext.cs
Last active August 29, 2015 14:27
C# stream reader
class ReadContext : IDisposable
{
public Stream Stream { get; private set; }
public Subject<Byte[]> Subject { get; private set; }
public Byte[] Buffer { get; private set; }
public Exception Error { get; private set; }
public DateTimeOffset Start { get; private set; }
public DateTimeOffset End { get; private set; }