å æ¥ãEãã¬ãããã¯ãªã¼ãºãã§ãããã®ããããã¨ããåãæ¾éããã¦ããã®ãåã¨ä¸ç·ã«è¦³ãã
ãã®ä¸ã§ãèªç¶çã«åºç¾ããä¸æè°ãªæ¨¡æ§ã¨ãã¦é»éæ¯ã»é»éè§ã«ãã£ã¦ä½ããã模æ§ãç´¹ä»ãã¦ããã å®éã«æ¨ã«æ¨¡ããæ£ã«çééã§çè§åº¦ãã¤ãããã¦é çªã«èãã¤ãã¦ããã¨ãã©ã®ãããªæ¨¡æ§ã«ãªãããã¨ãã£ãã·ãã¥ã¬ã¼ã·ã§ã³ããã¦ãã¦é¢ç½ãã
ç¨èªã¨ãã¦ã¯ãèåº (Phyllotaxis)ãã¨ãããããã
ããããã©ã¦ã¶ä¸ã§åãããã«ã·ãã¥ã¬ã¼ã·ã§ã³ã§ãããã®ãããã¨ä¾¿å©ã ãªãã¨æãä½ã£ã¦ã¿ããã¨ã«ããã
ææç©
3Dã§æ¨ã®å¹¹(æ¤ç©ã®è)ã¨ãã¾ããã«çééã§ä¼¸ã³ãèãæç»ããããã¦ã¹ãã¿ããæä½ã§å転/æ¡å¤§ç¸®å°ããããã¨ãã§ããã èã®æ°ãããã¦èã¨èã®éã®è§åº¦(é度 ã¨å¼ã¶ãããï¼)ãå¤æ´ããã¨ãªã¢ã«ã¿ã¤ã ã§æç»ãæ´æ°ãããã
ããªã»ããã®è§åº¦ã¨ãã¦ãé»éè§(ç´137.5° = 360 * (1 - 1 / Φ)
)ãããã¬ã¤ã«éãªã Ï/4 ãªã©ãé¸æã§ããã
å°ããã¤åããã¦ã¿ãã¨è²ã ãªæ¨¡æ§ã¨å¤åã観測ã§ãã¦æå¤ã¨æ¥½ããã
éçº
使ã£ã¦ããã®ã¯ Vite + React + TypeScript, Three.js, ã㨠Tailwindã
ããã³ãã¨ã³ãä¸æ £ããªèªåã§ããChatGPTã®ãããã§3æéãããã§ä½ããããããããã
ã¨ã«ãã3D空éå
ã«èãèãåæ±ã§è¡¨ç¾ãã¦é
ç½®ãã¦ãããè§åº¦ãθã¨ããã¨ãnçªç®ã®èã®ä½ç½®ã¯ (r * cos(θ * n), r * sin(θ * n), n * h)
ã¨ãã£ãæãã§æ±ããããããã¨ã¯é«ãã«åããã¦åå¾r
ãã¡ãã£ã¨èª¿æ´ãããã
Reactã«ãã£ã¦ inputã®å¤ãå¤æ´ãããå ´åã«ãããåæ ãããã©ãããã®ããªãã¨æã£ããã«ã¡ã©ãå
æºãrendererã¯ãã®ã¾ã¾å¤ããã«æ¸ããããuseRef
㧠THREE.Scene
ãä¿æãã¦ããã¦ããããã children ãä¸åº¦åé¤ãã¦æ°ãããã©ã¡ã¼ã¿ã§åé
ç½®ãã¨ããæ¹æ³ã§å®ç¾ã§ããã ãªãã¸ã§ã¯ãã®æ°ãå¤ãããªãå ´åã¯åº§æ¨ãè§åº¦ãå¤æ´ããã ãã«ãããã¨ãã£ãæé©åãã§ãããããããªããã©ãã¾ããããã
ãã åé¤ã¯ç°¡åã§ã¯ãªããã«ã¼ãã§åããªããæ¡ä»¶ã«ãããã®ã remove()
ãã¦ããã¨ä½æ
ãæ¶ãæ®ããã®ããã£ãããã¾ã¨ãã¦æ¶ãããã«ãã¦ã¿ã¦ãä½åº¦ãåé¤&åé
ç½®ãç¹°ãè¿ãã¨ã¡ã¢ãªãã©ãã©ãæ¯æ¸ãã¦ãã£ã¦ããªã¼ãºããããã¨ãã£ãåé¡ã«ã¶ã¤ãã£ããçµå±åé¤ããå ´åã¯ãã scene
ãã remove()
ããã ãã§ãªãããããã geometry
ã material
ãæ示çã« disopose()
ããå¿
è¦ããã£ãããã ã
ãã®ããããæ¹åããçµæãã¹ããã§ããµã¯ãµã¯åãããã«ãªã£ãã¨æãã