コードは波の形と色を決める部分に大きく分けられる。
- 形
- noise
- octave(重ね合わせ)
- choppy(鋭さ)
- 色
- fresnel的な屈折光と反射光の合成(拡散光で良い)
- 白いギラギラした照り返しを表現するspecular
- 深度とカメラ距離の加味(浅さと深さで明るさ調整)
コードは波の形と色を決める部分に大きく分けられる。
| 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 | |
| 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)) |
| 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 |
Steps:
$ means CLI command.
| 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/* |
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
reference: libuv/libuv#137
| 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) { |