Skip to content

Instantly share code, notes, and snippets.

コードは波の形と色を決める部分に大きく分けられる。

    • noise
    • octave(重ね合わせ)
    • choppy(鋭さ)
    • fresnel的な屈折光と反射光の合成(拡散光で良い)
    • 白いギラギラした照り返しを表現するspecular
  • 深度とカメラ距離の加味(浅さと深さで明るさ調整)
@ando-takahiro
ando-takahiro / egl.py
Created February 21, 2019 02:04
Based on PyGL headless test and @ototoi 's code
import OpenGL
import OpenGL.platform.egl
OpenGL.platform.PLATFORM = p = OpenGL.platform.egl.EGLPlatform()
from OpenGL import *
from OpenGL.GL import *
from OpenGL.EGL import *
from functools import wraps
import ctypes
@ando-takahiro
ando-takahiro / obj.py
Created June 7, 2018 03:28
a function convert numpy to wavefront .obj mesh
import numpy as np
def save(file_path: str, vertices: np.ndarray, indices: np.ndarray) -> None:
with open(file_path, 'w') as out:
for v in vertices:
out.write('v %f %f %f\n' % tuple(v))
for f in indices:
out.write('f %d %d %d\n' % tuple(f + 1))
@ando-takahiro
ando-takahiro / open3d-numpy-test.py
Created May 21, 2018 03:47
I'd like to share how we can exchange data between open3d.Image and numpy. I think this would be helpful for python beginners like me X)
from unittest import TestCase
from functools import reduce
import numpy as np
import numpy.testing as npt
from open3d.py3d import Image
class TestNumpyImage(TestCase):
>>> df = pandas.DataReader('ZEC-JPY', 'yahoo', start='2017-1-1')
>>> df
Open High Low Close \
Date
2016-12-31 5981.149902 6064.509766 5654.569824 5665.990234
2017-01-01 5918.910156 6188.500000 5668.419922 5761.459961
2017-01-02 5819.129883 6042.020020 5732.390137 5803.470215
2017-01-03 5878.740234 6144.790039 5727.410156 5817.720215
2017-01-04 6620.419922 7130.109863 6524.589844 6680.140137
@ando-takahiro
ando-takahiro / memo.md
Last active July 28, 2017 01:26
A memo to build FbxExporter for Unity 3D on Ubuntu

How to build FbxExporter

Steps:

$ means CLI command.

  • Import FbxExporter to your project
  • FBXSDK install
  • $ sudo apt install cmake
FROM nvidia/cuda:8.0-cudnn5-devel
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
python-dev \
python-setuptools \
python-pip && \
pip install --upgrade pip && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
@ando-takahiro
ando-takahiro / gist:96d4de66293c8f162f15
Created January 27, 2015 07:03
googletest on android memo

I succeeded with this modification. I'm making static library and its test.

add this to Application.mk

APP_PLATFORM := android-9
APP_STL := gnustl_static
NDK_TOOLCHAIN_VERSION=clang

APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char # you can reduce this options
@ando-takahiro
ando-takahiro / gist:28033ae1ad87a05029ea
Last active August 29, 2015 14:13
what I did to build libuv with cocos2d-x(3.0series)

iOS

  • $ ./gyp_uv.py -f xcode
  • make project from the generated xcodeproj

reference: libuv/libuv#137

Android

@ando-takahiro
ando-takahiro / set-timeout-libuv.cc
Last active August 29, 2015 14:08
THIS HAS BUGS: JS's setTimeout in C++ on libuv
template <typename Fn>
void set_timeout(Fn fn, uint64_t timeout, uv_loop_t* l = nullptr) {
struct payload {
uv_timer_t timer;
Fn fn;
payload(Fn&& f) : fn(f) {}
};
payload* p = new payload(std::move(fn));
if (!l) {