Skip to content

Instantly share code, notes, and snippets.

@akirayou
akirayou / LivePreview.cs
Last active May 14, 2022 22:04
Unityでthetaのプレビューをテクスチャに貼り付けるテスト。(Quest2で動作確認/thumstickで見る方向回転も追加)   skyboxのmaterialを view_materialに指定する。 マテリアルのshaderはskybox/Panoramicにしておく.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Net;
using System.IO;
using System.Threading.Tasks;
using System.Net.Http;
using System.Text;
using System.Threading;
// NOTE: requires the Encoder library.
// 1) open Tools -> Manage Libraries...
// 2) install "Encoder" by Paul Stoffregen v1.4.1
#include <Encoder.h>
// NOTE: Requires the PS2X_lib installed.
// 1) open Sketch -> Include Library -> Add .ZIP Library
// 2) select "PS2X_lib.zip"
#include <PS2X_lib.h>
@akirayou
akirayou / Chrom_sim.ipynb
Last active May 13, 2023 02:42
波形確認のためのクロマトシミュレーション(段理論)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<html>
<body>
<img id="a"/>
<script>
var img=document.getElementById("a");
img.addEventListener('load',function(){
img.src="http://atomcam.local/cgi-bin/get_jpeg.cgi?"+ Date.now();
//console.log("laod");
from flask import session
import streamlit as st
import plotly.express as px
import pandas as pd
from streamlit_plotly_events import plotly_events
import numpy as np
#乱数のダミーデータがパラメータ変更毎に変更されるとうざいのでcacheする
@st.cache
def get_data():
@akirayou
akirayou / nikkaji_dump.py
Last active March 27, 2022 14:10
NBDC版日化辞RDFから欲しいのだけををダンプする時の書き方のテスト。tar.gzの中のファイルは1~222まで別れてるのその番号ごとに処理すれば大丈夫っぽい?  https://dbarchive.biosciencedbc.jp/jp/nikkaji/desc.html
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 27 11:47:20 2022
@author: youak
"""
from rdflib import Graph
import tarfile
import gzip
<!DOCTYPE html>
<html>
<head>
<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
<script src="digest-fetch.js"></script>
<script src="script.js"></script>
</head>
<body>
<a-scene>
<a-camera wasd-controls-enabled="false"></a-camera>
@akirayou
akirayou / gltf_recv_shadow.js
Last active February 17, 2022 13:12
A-frame cast and recieve shadow in gltf model.
//for A-Frame
//使い方:<a-entity gltf-model="#glb" gltf_shadow ></a-entity>
// gltf でなければ shadow="receive: true;cast: true;" とするところ。
// しかしgltfでは無視されるのでgltf_shadowをしていして、以下のコンポーネントを適用させる
//
AFRAME.registerComponent('gltf_shadow', {
init: function () {
this.enableShadow();
@akirayou
akirayou / split_theta_mov.py
Created January 2, 2022 07:24
Split theta z1 movie file for meshroom
# -*- coding: utf-8 -*-
"""
引数にあるMP4ファイルから切りだす。
出力フォルダは [入力ファイル名]_rig
同時に処理されたファイルはファイル名が被らないようにしてあるので、
各rigフォルダのコピーしてまとめてmeshroomに突っ込む事ができる。
@author: akira_you
"""
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.