Skip to content

Instantly share code, notes, and snippets.

@ousttrue
ousttrue / CMakeLists.txt
Created June 3, 2019 13:39
emscripten glfw3 or webgl sample
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
PROJECT(em_gl VERSION 0.1.0)
LINK_DIRECTORIES(
$ENV{VCPKG_ROOT}/installed/x64-windows/lib
)
FILE(GLOB SRC
*.cpp
*.h
@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 / 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 / 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 *
@ousttrue
ousttrue / UnityHumanoidHelper.py
Last active July 22, 2021 21:26
Blender rig helper addon for Unity humanoid.
# coding: utf-8
"""
UnityHumanoidHelper
reference
https://github.com/sugiany/blender_mmd_tools
"""
import bpy
import math
@ousttrue
ousttrue / w32window.py
Created December 27, 2011 18:32
ctypes SetWindowLongPtr/GetWindowLongPtr sample
#!/usr/bin/env python
# coding: utf-8
import win32con
from ctypes import *
##############################################################################
# Windows types
##############################################################################
def ErrorIfZero(handle):
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
using System.Linq;
using System.Reflection;
using UnityEditor;
// using UnityEditor;
using UnityEngine;
@ousttrue
ousttrue / tasks.json
Last active March 11, 2020 10:35
Display changes of environment variables by vcvars64.bat
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "meson build --backend vs",
"options": {
@ousttrue
ousttrue / diff.patch
Created January 15, 2018 00:48
imgui patch for UWP build
diff --git a/examples/directx11_example/imgui_impl_dx11.cpp b/examples/directx11_example/imgui_impl_dx11.cpp
index 0442d78..48e971b 100644
--- a/examples/directx11_example/imgui_impl_dx11.cpp
+++ b/examples/directx11_example/imgui_impl_dx11.cpp
@@ -547,6 +547,7 @@ void ImGui_ImplDX11_Shutdown()
g_hWnd = (HWND)0;
}
+#ifndef UWP
void ImGui_ImplDX11_NewFrame()
@ousttrue
ousttrue / FFMpegYUV4Texture.cs
Last active November 7, 2019 09:04
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
{