KITASENJU DESIGN BLOG

memo, html, javascript, unity

Entries from 2022-01-01 to 1 year

lil-guiでaddColor使う

datguiの代わりlig-guiで色 bgColor:{color:number} = {color:0xff0000}; this.renderer.setClearColor(new THREE.Color(this.bgColor.color)); this.gui.addColor(this.bgColor,"color").onChange((value:number)=>{ this.renderer.setClearColor(new THREE…

typescriptでdictionary

TypeScriptの型: 辞書型を定義する (Dictionary)|まくろぐ

OBJLoaderなどの使い方

//import { ColladaLoader } from 'three/examples/jsm/loaders/ColladaLoader.js' //import { OBJLoader } from 'three/examples/jsm/loaders/OBJLoader.js' const loader = new OBJLoader(); loader.load('./data/q.obj', (obj)=>{ let mesh = obj.childre…

typescriptでinterface

export interface Point3 { x:number, y:number, z:number }

threejs用語(phongMaterial)

three.js docs 色 color = 照明の影響を受ける色 emissive = 他の照明の影響を受けない色 emissiveIntensity = その強度 specular specular = ハイライトの色、鏡面反射 shininess = ハイライトのシャイニー度で大きいほどシャープになる デフォ30 reflect…

RenderTextureをpngに保存(高速版)

save render texture as png pngとして画像を保存 using System.IO; using UnityEngine; using UnityEngine.Assertions; using UnityEngine.Rendering; using UnityEngine.UI; public class RenderTex2PNG : MonoBehaviour { [SerializeField] private Rende…

rayを使わずマウス位置を取得

Vector3 getMousePos(){ var p = Input.mousePosition; _mousePos.x = 2f*(p.x / (float)Screen.width - 0.5f); _mousePos.y = 2f*(p.y / (float)Screen.height -0.5f); float screenH = (float)_camera.orthographicSize;//OrthographicCameraにおける高さ …

chromeでスマホorientationテスト

devtool開く、 cmd+shift+pで検索窓みたいなのを出す、 そこにsensorsと入力、 show sensorsを選ぶ

イラレで曲線を直線群に

illustratorで描いた曲線を直線の集合に変換したいイラスト... - Yahoo!知恵袋

短冊状に切るシェーダー

いろんな角度で行けるように極座標にする 回転後の座標系を使い、ランダム関数に渡して短冊状のずれを生む float gx = glitch.z;//分割数 vec2 displace = vec2(0.0,0.0); float rad = glitch.y;//; //座標を回転 float nx = newUV.x * cos(-rad) - newUV.y …

webaudioをpause

this.context.suspend(); this.context.resume();

WebAudioのAudioBufferSourceNodeで最初から再生

基本使い捨てっぽい stopはあるが、1度startを呼んだらもう呼べない loopEndというパラメータは使える 以下のようにしたら開始点へのシークは成功した 任意の時間は無理だろう。 this.source.loopEnd=0.01; setTimeout(()=>{ this.source.loopEnd=this.sour…

lerp

どんなフレームレートでも同じ動きを実装できる 等比数列で一般化するLerpの係数 - ログミーTech

縦画面にぴったりあわせる threejs

const fovRad = (this.camera.fov / 2) * (Math.PI / 180); let distance = (window.innerHeight / 2) / Math.tan(fovRad); this.camera.position.set(0,0,distance); let scale:number = window.innerHeight/100;//meshのおおきさがwindow.innerHeightと同…

random glslは0-1の範囲

float random(vec2 co){ return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); }

typescript + threejs

Stats Panel - Three.js Tutorials 【React Three Fiber】Three.jsでShaderを使う準備をする - Qiita THREE.MeshPhongMaterialを改造する - Qiita three.js/ShaderLib.js at master · mrdoob/three.js · GitHub Three.jsとTypeScriptの開発環境を整えよう 最…

aftereffectsでループ

AEでループ レイヤーを右クリックし、time > enable time remapping 時計マークをoption押しながらクリック 再生マークを選んでproperty > loopOutを選ぶ

slit-scanのmemo

2009年以降のslit-scan 名前 Teis Draiby Skt. Hans Torv - Time Fold on Vimeo The Sausager and Morph Retina on Vimeo Ee 2 - interview francois vogel https://www.instagram.com/francois.vogel/ 他 https://www.instagram.com/p/ChWA36MjLTS/

sound flowerの代替

www.mimi-blog.info

unlit computeScreenPos

// Upgrade NOTE: upgraded instancing buffer 'Props' to new syntax. Shader "pieces/MyUnlitIndirect" { Properties { _Color ("Color", Vector) = (1.0, 0.0, 0.0, 1.0) _MainTex ("_MainTex", 2D) = "white" {} _MainTex2 ("_MainTex2", 2D) = "white" …

アプリ内課金を調べる iOS編

参考 【UnityIAP】世界一簡単に課金機能を実装する(サーバー不要)|マカロン【ゲーム開発】|note [Unity] IAP でiOSアプリ課金を実装(実装編) | hirokuma.blog App内課金をSANDBOXユーザーでテストする - AppStoreConnect編(2019年版) - Qiita コードなし…

meshをwireframe化する

using System.Collections; using System.Collections.Generic; using UnityEngine; public class LineMesh : MonoBehaviour { [SerializeField] private int[] _triangles; // Start is called before the first frame update void Start() { MeshFilter me…

DrawMeshIndirectedを何度か呼ぶ

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering; public class Duplicator : MonoBehaviour { [SerializeField] protected Mesh _mesh; [SerializeField] protected Material _mat; protecte…

How to use Graphics.DrawMesh

using System.Collections; using System.Collections.Generic; using UnityEngine; public class Duplicator : MonoBehaviour { [SerializeField] private Mesh _mesh; [SerializeField] private Material _mat; private MaterialPropertyBlock _block; pri…

ITMS-90338: Non-public API usage

apple connectにアプリをアップロードすると、メールで以下の項目がダメと言われる。 ITMS-90338: Non-public API usage 以下を確認する twitterで同じ人がいないか確認 別アプリもビルドして送信してみる それで同じ問題が出たら、Apple側の問題である可能…

iosのdialogueをunityで出す

iOSのダイアログを出す github.com _button.onClick.AddListener(_onClick); private void _onClick(){ string url = MyNativeBindings.GetSettingsURL(); CBNativeDialog.Instance.Show(title: "アクセス許可", message: "動画を保存するには写真へのアクセ…

許可

qiita.com

lidar

iwamaのことは知らないけどこのiPhone3Dスキャンアプリまとめ表は知ってるって人が多すぎ問題今日初めてリアルでこのスキャンアプリまとめ表作ってるのワイやで(ドヤ顔)ムーブかましてきた pic.twitter.com/zF8TRqovp7— iwama@iPhone LiDAR (@iwamah1) July …

how to escape SPACE

js

let hoge = "&nbspSLIT";

webdesignに挑戦

index.kitasenju.design ギミック すごく昔2000年台中頃、慶應SFCのサイトだったか、3種類のCSSが用意されていて、それをボタンで変更することができた。フォーマルなバージョン、ポップなバージョンなどあったと思う。今探しても見つからない。 情報の構造…

"FOOTER"