KITASENJU DESIGN BLOG

memo, html, javascript, unity

Entries from 2023-01-01 to 1 year

threejsでsvg

import * as THREE from 'three'; import { MeshBasicMaterial, BoxGeometry, Object3D, Shape, Vector3 } from 'three'; import { SVGLoader } from 'three/examples/jsm/loaders/SVGLoader'; export class MySVGLoader extends Object3D{ loader :SVGLoade…

p5jsで背景を透過

canvasを透過で使いたい。clearでいけた _p5.clear(0,0,0,0);//r,g,b,aの値

threejsで動的な線を描く

import * as THREE from 'three'; export class Lines extends THREE.Object3D{ numParticles:number=4000; strokes:THREE.Line; counter:number=0; countMax:number=0; positions :number[]; scales :number[]; geo :THREE.BufferGeometry; private mode :s…

simplest webgl

// キャンバス要素を取得 const canvas = document.getElementById("canvas"); // WebGLコンテキストを取得 const gl = canvas.getContext("webgl"); // 頂点シェーダのソースコード const vertexShaderSource = ` attribute vec4 a_position; void main() {…

threejsでlineを描く

import * as THREE from 'three'; import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls' import Stats from 'three/examples/jsm/libs/stats.module' import { TorusGeometry, MeshPhongMaterial, DirectionalLight, MeshBasicMateri…

typescript + glslify を使う

npm install npm install glslify npm install glsl-random @types/glslifyがなかったのでつくる chatGPTに教えてもらった。 glslify.d.tsというファイルを glslを入れてるフォルダに入れた // glslify.d.ts declare module 'glslify' { interface GlslifyOp…

typescriptで構造体的な型

正式になんて言うのかわからない。 クラスを定義するほどでないときに使っている。 以下ではrgbの変数を持っているものを配列として定義 public colors:{r:number,g:number,b:number}[];

cssのスペースの意味

スペースある/なしで意味が違う csshtml.work ul.A - ulタグのクラスAを指定 ul .A - ulの子要素でのクラスA ul:first-child - 1つ目のul要素 ul :first-child - 全ての子要素

scrapbox css

/* pinnedのグループを独立させる */ .page-list-item.pin + .page-list-item:not(.pin) { clear: both; } /* ピンされたタイトル */ div.header.pinned{ background: #4c4; } /* アイテムの上のボーダー */ .grid li.page-list-item a .header{ border-top:…

p5でクラスを書く

let bugs = []; // array of Jitter objects function setup() { createCanvas(710, 400); // Create objects for (let i = 0; i < 50; i++) { bugs.push(new Jitter()); } } function draw() { background(50, 89, 100); for (let i = 0; i < bugs.length; …

AE blendMode

メモ hue - 色相を変化させる hardmix - 極端な色

AEで連番ファイルのプロパティ

連番ファイルを読み込んだが、どこのファイルを読み込んだかわからなくなってしまった。 Replace footage > Place holder で元の名前を見たり、フレームレート、画角などが変えられる pathは、projectウィンドウの右の方を見ていくと載ってる。

cursor png

simple cursor pixelart

p5jsで加算

加算で画面を黒色にリセットにしたい時 一回BLEND(デフォルト)に戻さないとダメだ this._p5.blendMode(this._p5.BLEND); this._p5.background(0,0,0,255);//「全画面をこの色で塗る命令」なので加算だと何も色が塗られない this._p5.blendMode(this._p5.AD…

Save PNG from canvas using File System Access API

single file with FilePicker Save png from canvas element using File System Access API https://codepen.io/kitasenjudesign/pen/NWLGVWQ var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.moveTo(0, 0); ctx.lineTo(40…

createjsとは

AdobeAnimateからhtml5書き出しするとcreatejsと共に書き出される createjsはActionScriptのFlash PlayerのAPIに似せて作ったAPI。 Animateで作ったtimelineがMovieClipクラスのインスタンスになる stageにそのインスタンスがaddChildされてる tickがupdate…

seed対応random

seedで数値が固定される乱数が欲しい。 sbfl.net ↑こちらを参考にさせていただき、 Math.random()の代替となるようvalue()関数を新設しました export class SRandom { x:number=0; y:number=0; z:number=0; w:number=0; public static instance:SRandom; pub…

Colorized standard images

アカデミックな画像処理業界で使われていたモノクロ標準画像のgirlとcameramanという画像をフォトショのニューラルフィルターという機能でカラーにした と思ったが、girlのカラー版は元々すでににあった。 www.ess.ic.kanagawa-it.ac.jp

トマソン

立体物、建築物、彫刻的 作り手が存在しない、鑑賞者のみ。(超芸術の所以) 機能があったものが無機能化。無用の超物 要素が削れる。要素が加わる。文脈・解釈変化。 デペイズマン的な違和感・おもしろさ。文脈の違和感 街中(日常)に突然現れる違和感(非…

アンチユーザビリティ原則

ニールセンのユーザビリティ原則というのを知ったのでアンチユーザビリティ原則を考えた。 uxdaystokyo.com アンチユーザビリティ原則 1.ステータスの不可視 2.現実世界とシステムの不一致 3.操作に主導権がなく不自由 4.一貫性がなく特殊 5.エラーの推奨 6.…

vscodeでomniSharpの調子が悪い

outputでomniSharpのログを見るとwarnがでている useModernNetをfalseにしろみたいなことがかいてあった falseにし、omniSharpをリスタートする monoのフルパッケージをダウンロードしろ、みたいなことを言われる 以下の右側の方をインストール Download - S…

クリエーティブコーディングという曖昧な言葉を整理する

クリエーティブコーディングという言葉について、いろいろな解釈がある気がするので2種類に分類してみました。 特に「creative」という語について考えます。 「creative」の意味 https://www.oxfordlearnersdictionaries.com/definition/english/creative_1…

hitTest

using System.Collections; using System.Collections.Generic; using UnityEngine; public class HitTest : MonoBehaviour { // Start is called before the first frame update void Start() { } void OnCollisionStay(Collision collision) { Debug.Log("…

Fusen

付箋(比喩)のようにインスペクターにメモ欄を入れる using System.Collections; using System.Collections.Generic; using UnityEngine; public class Fusen : MonoBehaviour { #if UNITY_EDITOR [SerializeField, MultilineAttribute (2)] string message…

"FOOTER"