KITASENJU DESIGN BLOG

memo, html, javascript, unity

Entries from 2021-11-01 to 1 month

Reset Wi-Fi setting on FRAMED MONO X7

FRAMED MONO X7のwifi設定をリセットする方法 前提 まずスマホアプリがうまくいかなかった うまくいった方法 PCで https://frm.fm/settings/devices にアクセス NEW SETUPからwifi設定等を入力、Download Settingsからxmlをダウンロード。 そのファイルをUSB…

shader dot pattern

https://glslsandbox.com/e#77263.0 #extension GL_OES_standard_derivatives : enable precision highp float; uniform float time; uniform vec2 mouse; uniform vec2 resolution; void main( void ) { vec2 position = ( gl_FragCoord.xy / resolution.xy…

ふたつのsmoothstep

//return x * x * (3.0 - 2.0 * x); return 6.0*x*x*x*x*x - 15.0*x*x*x*x + 10.0*x*x*x;

アイコンを探す

icon ikonate.com https://remixicon.com/ https://ionic.io/ionicons

draw lines randomly on unity

ランダムに線を描く using System.Collections; using System.Collections.Generic; using UnityEngine; public class Lines : MonoBehaviour { [SerializeField] private MeshFilter _meshFilter; private Vector3[] _positions; private Mesh _mesh; // St…

微分と積分を位置・速度・加速度で理解する

微分=傾き 位置が時間とともに変化していく 位置の変化量=速度 速度の変化量=加速度(→速度一定なら加速度0) 積分=面積 速度の積分=距離(=位置) 加速度の積分=速度(加速度が一定の値なら、その面積(速度)は一定で増えていく)

circle wave 円弧波

glslのコード float circleWave(float t) { float d=1.0; float st = sin(d * 3.1415 / 2.0); float p = (mod(t * 4.0, 2.0) - 1.0) * st; float a = sqrt(1.0 - pow(p, 2.0)); float amax = sqrt(1.0 - pow(st, 2.0)); float b = sign(mod(t, 1.0) - 0.5); …

ZXingでQRコード作る

using System.Collections; using System.Collections.Generic; using UnityEngine; using ZXing; using ZXing.QrCode; using System.IO; public class BarcodeMaker : MonoBehaviour { private Texture2D _tex; void Start() { var text = "http://hogehoge…

particle system rescale

子供のパーティクルサイズを親のスケールにあわせてリスケール public class ChildParticleScaler : MonoBehaviour { float scale; List<ParticleSystem> particles = new List<ParticleSystem>(); void Start() { scale = transform.localScale.x; particles.AddRange(GameObject.FindObject</particlesystem></particlesystem>…

Mapping function - マッピング関数

js function map (value, fromMin, fromMax, toMin, toMax){ return (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) + toMin; } glsl float map (float value, float fromMin, float fromMax, float toMin, float toMax){ if(value<fromMin)value=fromMin; if(value>fromMax)valu</frommin)value=frommin;>…

シェーダーで陰つける

陰影の、陰(shader)をつける Shader "RDSystem/Surface2" { Properties { _MainTex("RD Texture", 2D) = "white" {} [Space] _Color0("Color 0", Color) = (1,1,1,1) _Color1("Color 1", Color) = (1,1,1,1) [Space] _Smoothness0("Smoothness 0", Range(0, …

ParticleSystemのrenderer moduleへのアクセス

gameObject.GetComponent<ParticleSystemRenderer>();</particlesystemrenderer>

trail rendererのresetがおかしい

おかしいので trail rendererだけgameObjectを単独にし、使う時だけInstansiateする。

vfx graph start/stop

using UnityEngine.VFX; VisualEffect _effect; _effect.Play(); _effect.Stop();

generating 3d texture on script

var info = new RenderTextureDescriptor(); info.dimension=UnityEngine.Rendering.TextureDimension.Tex3D; info.colorFormat = RenderTextureFormat.ARGB32; info.width = 512; info.height=256; info.volumeDepth=90; info.depthBufferBits = 0; info.ms…

singleton

using UnityEngine; public class SingletonExample : MonoBehaviour { private static SingletonExample _instance; void Awake(){ if (_instance == null){ _instance = this; DontDestroyOnLoad(this.gameObject); //Rest of your Awake code } else { De…

free fbx suit man

フリーのリアルなスーツおじさんdennisのfbx renderpeople.com

Header attributeに複数行書く時 orderをかく

must add order number to write multi line texts [Header("●ARBackgroundからテクスチャを作るクラス",order = 1)] [Space(10,order = 2)] [Header("ARFoundation機能への参照",order = 3)]

"FOOTER"