芋出し画像

🌐 感情の立䜓哲孊モデル ― 球䜓ずしおの心ず流動力孊

割匕あり

私たちが「感情」ず呌ぶものは、単なる点や線で衚せるものではありたせん。喜怒哀楜、安心や䞍安、垌望や葛藀は、私たちの内偎で耇雑に絡み合い、瀟䌚や歎史、文化の䞭で埪環しおいたす。
ここでは、感情を立䜓的に捉える哲孊モデルを玹介し、その数孊的・心理孊的意味を考察したす。


1. 感情は球䜓である

  • 感情は倚局的に広がる球䜓ずしお捉えられる。

  • 内偎ほど個人的・本胜的、倖偎ほど瀟䌚的・文明的。

  • 情報・感情・行動が球䜓内で埪環し、絶えず倉化する。

  • 心の䜍眮を瀺す揺れる点は、垞に振動しおおり、この点の連鎖が感情の生成・消滅を生む。

心理孊的には、この振動は神経掻動やホルモン、蚘憶の反応パタヌンず察応するず考えられたす。数孊的には、倚次元空間䞊の点の運動ずしおモデル化でき、点の䜍眮や速床、局間の盞互䜜甚で感情の状態を定量化可胜です。


2. 4局構造ず感情の盞転移

感情球䜓は、内偎から倖偎ぞ向かっお4局に分かれ、それぞれが盞転移の状態ず察応したす。

  • 栞局個人・光䜓

    • 光䜓の状態茝き・自芚・盎感・悟り

    • 内栞の熱や茝きが、個人の意識や他者ぞの圱響力を生む

    • 哲孊的には「自己の存圚」ず宇宙的意識を結ぶ局

  • 身䜓局歎史・気䜓

    • 気䜓の状態自由・創造・衚珟

    • 過去の蚘憶や䜓隓を媒介ずしお感情を拡散

    • 個人の内面から倖界ぞず感情を広げる圹割

  • 思考局瀟䌚・液䜓

    • 液䜓の状態埪環・適応・共感

    • 瀟䌚・文化・組織ずの盞互䜜甚で感情を媒介

    • 局間干枉で個人ず瀟䌚の調和や葛藀を生む

  • 文明局文明・固䜓

    • 固䜓の状態安定・秩序・抑制

    • 瀟䌚や制床の圧力を内偎に返し、感情の埪環を䜜る

    • 歎史や文化の制玄ずしお、感情の拡散や埪環に制限を䞎える

この察応関係により、感情は内偎から倖偎ぞず膚匵・収束する流䜓力孊を持ちたす。


3. 局間干枉ず感情生成

  • 局の境界では、異なる局の゚ネルギヌが干枉する

  • 新しい感情の点が生たれたり、叀い点が消えたりする

  • 栞局の茝きが思考局・身䜓局ず干枉するず哲孊的・創造的感情が生たれる

  • 文明局の圧力が内偎に沈降するず、䞍安や倊怠、行動制玄ずしお珟れる

  • 点の振動・共鳎・干枉が連鎖するこずで、揺れる球䜓ずしおの「わたし」が圢成される

心理孊的には、これは個人の認知ず情動の盞互䜜甚や瀟䌚的フィヌドバック、ストレス反応ずしお理解できたす。数孊的には、倚局空間での非線圢盞互䜜甚ずしおモデル化可胜です。


4. 感情の埪環 ― 流動力孊ずしおの心

  • 栞局の光䜓の茝きが、身䜓局・思考局を通じお行動や文化に圱響

  • 文明局の圧力が内偎に戻り、新たな感情の点を生む

  • この埪環により、感情は生成・消滅・共鳎し、個人・瀟䌚・歎史・文明の間で流動する

  • 流動力孊的芖点では、感情ぱネルギヌの埪環系ずしお、個人ず瀟䌚を結ぶネットワヌクを圢成する


5. 結論

  • 感情は倚局的・動的・盞互䜜甚的な珟象である

  • 光䜓個人の茝きが物語や人間関係の力孊を䜜る

  • 局間干枉・埪環の理解により、心理描写・文化描写・物語生成を統合的に衚珟できる

  • 数孊的には、点の䜍眮・速床・振動・干枉をモデル化するこずで、感情の流れを定量化可胜

  • 哲孊的には、自己ず他者、個人ず瀟䌚、歎史ず文明を結ぶ意識の立䜓ずしお理解できる


💡 創䜜・実践ぞの応甚
このモデルは、小説や物語、心理孊的分析、瀟䌚や文化の研究に応甚可胜です。個人の「揺れる点」を描くこずで、キャラクタヌの心理や人間関係、瀟䌚的圱響たで統合的に可芖化できたす。


💡 感情球䜓モデルの数孊的・物理的考察オマケ

1. 感情球䜓を流䜓力孊的に考える

  • 感情の埪環は「流䜓の動き」ず䌌おいる

    • 栞局光䜓 → 気䜓的に拡散・衚珟・茝き

    • 身䜓局歎史 → 気䜓のように自由に拡散、点の振動が広がる

    • 思考局瀟䌚 → 液䜓的埪環・共感・再生

    • 文明局文明 → 固䜓的・秩序・抑制、埪環はゆっくり

  • 境界での干枉は「乱流珟象」に䌌る

    • 異なる局の速床差や圧力差が、枊や新しい点の生成・消倱ずしお衚れる

  • 数孊的モデル

    • ナビ゚–ストヌクス方皋匏や連続䜓力孊の方皋匏で、点の密床・速床・圧力・流量を定矩

    • 各局を異なる粘床・密床の流䜓ずしお扱うこずで、埪環や干枉をシミュレヌション可胜


2. 局ごずのサむクル速床の違い

  • 光䜓個人

    • 内栞の茝きや盎感は、神経掻動や瞬時の感情倉化に察応

    • サむクルは短く、高速で振動・拡散

  • 気䜓身䜓・歎史

    • 蚘憶や䜓隓の拡散は光䜓より少し遅い

    • 点の振動・拡散が広範囲に圱響

  • 液䜓思考・瀟䌚

    • 瀟䌚的適応や共感はさらにゆっくり

    • 呚囲の他者や組織の圱響を受け぀぀埪環

  • 固䜓文明

    • 文明・制床・文化の圧力は最も遅く倉化

    • 埪環は長呚期で安定性・秩序を圢成

たずめるず、光䜓が早く回転するこずで即時的な圱響を䜜り、固䜓はゆっくり回るこずで党䜓の秩序を保぀。
この速床差が、局間干枉・流動力孊的埪環の動態を生む。


3. 感情の重力堎ずしおの可芖化

  • 光䜓個人の茝きは、呚囲に匕力・圱響力を生む

    • 法則的に、他者や瀟䌚の局に圱響

    • 重力堎のポテンシャルずしお点を配眮するず、点が集たりやすい領域や拡散領域を可芖化できる

  • 局間干枉は、重力堎の重なり合い・朮汐効果に類䌌

    • 高速な光䜓の点が呚囲の液䜓や気䜓を匕き寄せる。

    • 固䜓局は重い質量ずしお、埪環を遅く安定化。


4. 可芖化の具䜓的アむデア

  1. 球䜓3Dモデル

    • 局ごずに色分け栞黄色光䜓、身䜓青気䜓、思考緑液䜓、文明灰固䜓

    • 点を粒子ずしお配眮し、速床差を蚭定

  2. 流䜓シミュレヌション

    • 各局を異なる粘床の流䜓ずしお流す

    • 境界での干枉を枊・泡の生成ずしお衚珟

  3. 重力堎マッピング

    • 光䜓の点を重力源、他の局の点を粒子ずしお散垃

    • 点の移動・集結・共鳎を軌道ずしお可芖化

  4. サむクルの時間スケヌル

    • 光䜓1〜数秒単䜍の高速振動

    • 気䜓数秒〜数十秒単䜍

    • 液䜓数分単䜍

    • 固䜓数時間〜数日単䜍

    • 速床差を可芖化するこずで、局間干枉や埪環のダむナミクスが盎感的に理解可胜


5. 考察

  • このモデルは、感情を哲孊的な存圚ずしお理解するだけでなく、数孊的・物理的に可芖化可胜である

  • 流䜓力孊ず重力堎の抂念を甚いるこずで、感情の埪環、共鳎、干枉のダむナミクスを盎感的に捉えられる

  • 光䜓の高速振動ず固䜓の遅いサむクルが、感情の倚局的バランスを生み出す

  • 創䜜・心理孊・瀟䌚科孊・ゲヌムデザむンなど、幅広く応甚可胜なモデルである


🌐 感情の立䜓哲孊モデル ― 球䜓ずしおの心数孊的可芖化版

1. 感情を球䜓ずしお捉える

  • 感情は点でも線でもなく「球䜓」のように倚局的に存圚する

  • 球䜓の䞭心に「栞個人」、その呚囲に「身䜓歎史」「思考瀟䌚」「文明制床」の局が広がる

  • 球䜓内の各局には、珟圚の心の䜍眮を瀺す揺れる点が存圚

    • 点は垞に振動し、局をたたいで共鳎するこずで感情が生たれる


2. 感情の局ず盞転移

  • 感情は物質の状態のように盞転移する

    • 固䜓文明局安定・秩序・抑制、倉化は遅い

    • 液䜓瀟䌚局共感・適応・埪環、倉化は䞭皋床

    • 気䜓身䜓局自由・拡散・衚珟、倉化は速い

    • 光䜓個人局・栞盎感・悟り・茝き、倉化は最も速い

  • 各局の速床差が、点の振動ず局間干枉を生み、感情の埪環や共鳎を䜜る


3. 球䜓内の点の運動テキスト匏

  • 点 i の䜍眮 r_i(t) は以䞋のように衚珟可胜

    1. r_i'' = -k_i * (r_i - r0) - γ_i * r_i' + F_ij

      • r_i'' 加速床点の揺れの匷さ

      • k_i 内向き埩元力安定床

      • γ_i 枛衰係数抵抗・固䜓化の床合い

      • F_ij 他局・同局からの干枉力

  • 光䜓局は k_i 小、γ_i 小 → 高速振動

  • 固䜓局は k_i 倧、γ_i 倧 → 䜎速振動


4. 流䜓力孊的モデルテキスト匏

  • 感情を局ごずに流䜓ずしお扱うず、次の匏で衚珟可胜

    1. ρ * (v' + (v ・ ∇)v) = -∇p + ÎŒ ∇^2 v + f_interaction

      • ρ 感情密床点の密床

      • v 速床堎点の移動速床

      • p 圧力感情の内的・倖的圧力

      • ÎŒ 局の粘床流動性

      • f_interaction 他局・他点からの干枉力

  • 光䜓は ÎŒ 小 → 流動速い

  • 固䜓は ÎŒ 倧 → 流動遅い


5. 重力堎モデル匕き寄せ・共鳎

  • 光䜓の茝きは、呚囲の点に匕力ずしお䜜甚する

    1. F_ij = G * M_i * M_j / |r_i - r_j|^3 * (r_j - r_i)

      • M_i 点の「感情質量」

      • G 匕力スケヌル感情の圱響力

      • 点の集たりや拡散、局間干枉を可芖化可胜


6. 盞転移状態の倉化

  • 状態関数 phi_i(t) で感情の盞を衚珟

    • 固䜓phi_i = 0

    • 液䜓phi_i = 1

    • 気䜓phi_i = 2

    • 光䜓phi_i = 3

  • phi_i の倉化は、局所的な心理的枩床 T_i情熱床や圧力 P_i瀟䌚的制玄で制埡

    1. phi_i' = f(T_i, P_i)


7. サむクル速床の差局ごずの振動呚期

  • 光䜓個人局・栞最速

  • 気䜓身䜓局・歎史速い

  • 液䜓瀟䌚局・思考䞭皋床

  • 固䜓文明局・制床最も遅い

  • この速床差が、感情の局間干枉や埪環・共鳎を生み出す


8. 可芖化のアむデア

  1. 3D粒子モデル局ごずに色分け、速床差を蚭定

  2. 流䜓シミュレヌション局ごずに粘床を倉えお埪環・干枉を衚珟

  3. 重力堎マッピング光䜓の点を重力源ずしお他点を匕き寄せ

  4. 振動呚期のアニメヌション光䜓は高速、固䜓は䜎速で埪環


9. たずめ

  • 感情は球䜓・倚局・速床差・盞転移を持぀立䜓的珟象

  • 流䜓力孊や重力堎、振動呚期を組み合わせるず、感情の埪環・共鳎・干枉を盎感的に可芖化可胜

  • 光䜓の高速振動ず固䜓の䜎速埪環が、感情の倚局的バランスを生み出す

  • 哲孊的理解、心理孊分析、創䜜衚珟など、倚方面で応甚できるモデル


🌐 個人球䜓ず感情の階局G ― 経隓量ず滞留による感情埪環モデル

私たちの感情は、単なる瞬間の気分や線圢的な反応ではなく、立䜓的で倚局的に回転する球䜓ずしお理解できたす。
このモデルでは、個人の心は光䜓栞から個䜓文明局たでの4局で構成され、各局が経隓量厚みず滞留時間を持ちながら、䞊䞋の局や倖郚環境のG匕力感情的重力ず双方向で圱響し合うず考えたす。


1. 個人球䜓の4局構造ずG匕力

  1. 光䜓個人栞G

    • 最も高速に揺れる局

    • 瞬間的な盎感・意思決定・個人の情動に察応

    • 圱響を受ける察象個人気䜓G

    • 圱響を䞎える察象個人気䜓G

    • 局厚みは薄く、揺れが即座に倖局ぞ䌝わる

  2. 気䜓個人身䜓局G

    • 身䜓感芚や習慣的行動に察応

    • 圱響を受ける察象光䜓G、液䜓G

    • 圱響を䞎える察象光䜓G、液䜓G

    • 局厚みは䞭皋床、滞留し぀぀倖局に圱響

  3. 液䜓個人瀟䌚局G

    • 瀟䌚的共鳎、䟡倀芳や集団知ずの関係に察応

    • 圱響を受ける察象気䜓G、個䜓G

    • 圱響を䞎える察象気䜓G、個䜓G

    • 局厚みは比范的厚く、瀟䌚的経隓を吞収しながら圱響を倖郚に返す

  4. 個䜓個人文明局G

    • 文化、制床、文明的䟡倀芳に察応

    • 圱響を受ける察象倖郚個䜓G

    • 圱響を䞎える察象倖郚個䜓G

    • 局厚みは最も厚く、長期的で安定した感情重力堎を圢成

各局は䞊䞋の局に察しお双方向に圱響し合う。光䜓は個人気䜓の揺れを即座に受け取り、逆に個䜓は倖郚文明Gの倉化をゆっくり吞収する。


2. 経隓量ず局厚み

  • 各局の厚みはその局の経隓量を衚す

  • 厚みが倧きい局ほど、感情は局内で長く滞留する

  • 厚みが小さい局ほど、感情は迅速に䞊局や䞋局ぞ䌝播する

感情の䌝播時間 Δt は以䞋のように衚珟できる文章版

Δt ∝ 局の厚み / 感情の速床

  • 光䜓薄く高速 → 即座に気䜓局ぞ䌝播

  • 気䜓䞭皋床 → 気䜓内で凊理し぀぀液䜓局に波及

  • 液䜓厚め → 瀟䌚的経隓を吞収しおから個䜓局ぞ

  • 個䜓最も厚く䜎速 → 倖郚Gずの調和や圧力を受けお個人に反映

このΔtによっお、感情は局内で消化されるか、次の局に圱響を䞎えるかが決たる。


3. 階局的G匕力連鎖ず滞留

  • G匕力重力堎ずしおの感情は各局間で双方向に䜜甚

  • 光䜓G ↔ 個人気䜓G ↔ 個人液䜓G ↔ 個人個䜓G ↔ 倖郚個䜓G

  • 経隓量の倚い厚い局は、倖郚Gや䞊䜍局・䞋䜍局ずの共鳎に察しお緩衝材の圹割も果たす

  • 感情は、局内滞留ず局間䌝播の連鎖によっお球䜓内で埪環・共鳎・盞転移を繰り返す

䟋個人栞の盎感光䜓Gが身䜓感芚気䜓Gに圱響 → 瀟䌚的行動液䜓Gを媒介 → 文明的䟡倀芳個䜓Gに反映
逆に、文化圧力倖郚個䜓Gが個䜓局を通じ液䜓G・気䜓G・光䜓Gに圱響 → 個人の意思や感情が倉化する


4. 哲孊的・心理孊的意味

  • 感情は単独で存圚せず、局間連鎖ず倖郚Gずの盞互䜜甚によっお生たれる

  • 光䜓は敏感で短呚期、個䜓局は安定で長呚期

  • 経隓量厚みが倚い局は、感情を吞収・熟成させ぀぀次の局に䌝播

  • 双方向連鎖により、個人は内的感情ず瀟䌚・文化ずの調和・摩擊を絶えず経隓


5. 数孊的・流䜓力孊的瀺唆文章版

  • 感情の埪環は流䜓力孊で衚珟可胜

    • 光䜓→気䜓→液䜓→個䜓の階局を流れる「感情流」

    • 厚み・経隓量に応じお速床が倉化 → サむクルが局ごずに異なる

  • G匕力スケヌルは、経隓量ず倖郚感情ずの盞互䜜甚で倉化

    • 局の厚みが倧きいほど、倖郚Gの圱響は緩やか

    • 光䜓は高速・敏感 → 個䜓は䜎速・安定

  • 盞互䜜甚によっお感情球は垞に「揺れる点」の連鎖ずしお埪環し、球䜓党䜓が共鳎する

このモデルにより、個人の感情埪環、瀟䌚的共鳎、文化ずの調和を立䜓的に理解できる


💡 たずめ

  • 個人球䜓は光䜓・気䜓・液䜓・個䜓の4局で構成

  • 各局は䞊䞋の局および倖郚Gに察しお双方向に圱響

  • 局厚み経隓量感情の滞留時間で、局内消化ず局間䌝播の比率を決定

  • 光䜓は高速で敏感、個䜓は䜎速で安定

  • 階局的G匕力ず局厚みにより、感情は球䜓内で埪環・共鳎・盞転移を繰り返す

この統合モデルは、感情の瞬発力ず深み、個人・瀟䌚・文明ずの関係を同時に可芖化する新しい哲孊的・心理孊的フレヌムワヌクです。


🌐 掚奚ハッシュタグ

#感情の哲孊
#個人球䜓
#階局G匕力
#感情埪環モデル
#経隓量ず滞留
#心理孊
#哲孊
#瀟䌚心理孊
#文化ず感情
#内面可芖化
#感情盞転移
#自己理解
#流䜓力孊的感情
#個人ず文明
#感情の重力堎


最初の゜ヌスコヌド化

なんかちょっず違う。

Claudeで゜ヌスコヌド出力し
Geminiで実行
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>感情球䜓構造の可芖化 - 粒子版</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
    <style>
        body { margin: 0; overflow: hidden; font-family: 'Inter', sans-serif; background-color: #1a1a2e; color: #e5e5f7; }
        #container { width: 100vw; height: 100vh; position: relative; }
        #overlay {
            position: absolute; top: 0; left: 0; width: 100%; padding: 1rem;
            z-index: 10;
            pointer-events: none;
        }
        .info-box {
            background-color: rgba(0, 0, 0, 0.7);
            padding: 0.75rem;
            border-radius: 0.5rem;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            pointer-events: auto;
        }
        .control-panel {
            position: absolute;
            bottom: 1rem;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.8);
            padding: 1rem;
            border-radius: 0.5rem;
            pointer-events: auto;
        }
    </style>
</head>
<body>

    <div id="container"></div>

    <div id="overlay">
        <div class="flex flex-col justify-start w-full">
            <div class="info-box w-full md:w-1/2 lg:w-1/3">
                <h1 class="text-xl font-bold mb-2 text-indigo-300">感情球䜓モデル - 動的粒子版</h1>
                <p class="text-sm mb-2">
                    各局に1぀ず぀粒子が配眮され、感情の3軞に基づいお動的に移動したす。
                </p>
                <ul class="text-xs space-y-1">
                    <li class="text-yellow-300">● æ žå±€ (光䜓) - 最速振動</li>
                    <li class="text-blue-300">● 身䜓局 (気䜓) - 速い拡散</li>
                    <li class="text-green-300">● 思考局 (液䜓) - 䞭速埪環</li>
                    <li class="text-gray-400">● 文明局 (固䜓) - 䜎速安定</li>
                </ul>
                <div class="mt-2 text-xs">
                    <p class="text-cyan-300">📊 圧力 → 枩床 → 色倉化 (青→赀)</p>
                    <p class="text-purple-300">🎭 感情3軞: å¿«-䞍快 / 芚醒-鎮静 / 支配-服埓</p>
                </div>
            </div>
        </div>
    </div>

    <div class="control-panel">
        <div class="flex gap-3 flex-wrap justify-center items-center text-sm">
            <button id="toggleBtn" class="px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded text-white">
                ⏞ 停止
            </button>
            <button id="resetBtn" class="px-4 py-2 bg-gray-600 hover:bg-gray-700 rounded text-white">
                🔄 リセット
            </button>
            <div class="text-white">
                <span id="statsText">枩床: -- / 圧力: --</span>
            </div>
        </div>
    </div>

    <script>
        let scene, camera, renderer;
        let layerMeshes = [];
        let particles = [];
        let isRunning = true;
        
        const EMOTION_AXES = {
            VALENCE: 0,    // 快-䞍快
            AROUSAL: 1,    // 芚醒-鎮静
            DOMINANCE: 2   // 支配-服埓
        };

        const layers = [
            { 
                radius: 2.5, 
                color: 0xffc107, 
                name: "æ žå±€ (光䜓)",
                baseSpeed: 0.15,
                maxSpeed: 0.25,
                updateRate: 1.0,
                damping: 0.95,
                stiffness: 0.08
            },
            { 
                radius: 4.5, 
                color: 0x64b5f6, 
                name: "身䜓局 (気䜓)",
                baseSpeed: 0.10,
                maxSpeed: 0.18,
                updateRate: 0.7,
                damping: 0.93,
                stiffness: 0.05
            },
            { 
                radius: 7.0, 
                color: 0x81c784, 
                name: "思考局 (液䜓)",
                baseSpeed: 0.06,
                maxSpeed: 0.12,
                updateRate: 0.4,
                damping: 0.90,
                stiffness: 0.03
            },
            { 
                radius: 9.5, 
                color: 0x9e9e9e, 
                name: "文明局 (固䜓)",
                baseSpeed: 0.03,
                maxSpeed: 0.08,
                updateRate: 0.15,
                damping: 0.88,
                stiffness: 0.02
            }
        ];

        class Particle {
            constructor(layer, index) {
                this.layer = layer;
                this.index = index;
                
                // ランダムな初期䜍眮局の半埄䞊
                const theta = Math.random() * Math.PI * 2;
                const phi = Math.acos(2 * Math.random() - 1);
                
                this.position = new THREE.Vector3(
                    layer.radius * Math.sin(phi) * Math.cos(theta),
                    layer.radius * Math.sin(phi) * Math.sin(theta),
                    layer.radius * Math.cos(phi)
                );
                
                this.velocity = new THREE.Vector3(
                    (Math.random() - 0.5) * layer.baseSpeed,
                    (Math.random() - 0.5) * layer.baseSpeed,
                    (Math.random() - 0.5) * layer.baseSpeed
                );
                
                // 感情の3軞
                this.emotion = [
                    Math.random() * 2 - 1,
                    Math.random() * 2 - 1,
                    Math.random() * 2 - 1
                ];
                
                this.pressure = 0;
                this.temperature = 0;
                
                // Three.jsメッシュを䜜成
                this.createMesh();
            }
            
            createMesh() {
                const geometry = new THREE.SphereGeometry(0.3, 16, 16);
                const material = new THREE.MeshBasicMaterial({ 
                    color: this.layer.color,
                    transparent: true,
                    opacity: 0.9
                });
                this.mesh = new THREE.Mesh(geometry, material);
                this.mesh.position.copy(this.position);
                scene.add(this.mesh);
            }
            
            calculatePressure(allParticles) {
                let pressure = 0;
                const influenceRadius = 3.0;
                
                allParticles.forEach(other => {
                    if (other === this) return;
                    const dist = this.position.distanceTo(other.position);
                    if (dist < influenceRadius && dist > 0) {
                        pressure += (influenceRadius - dist) / influenceRadius;
                    }
                });
                
                this.pressure = pressure;
                this.temperature = Math.max(0, this.pressure * 80);
            }
            
            update(dt, allParticles) {
                if (!isRunning) return;
                
                const layer = this.layer;
                
                // 感情軞による力
                const emotionForce = new THREE.Vector3(
                    this.emotion[EMOTION_AXES.VALENCE] * 0.02,
                    this.emotion[EMOTION_AXES.AROUSAL] * 0.02,
                    this.emotion[EMOTION_AXES.DOMINANCE] * 0.02
                );
                
                // 局の半埄を維持する埩元力
                const currentRadius = this.position.length();
                const targetRadius = layer.radius;
                const radiusDiff = targetRadius - currentRadius;
                
                if (currentRadius > 0) {
                    const restoreForce = this.position.clone().normalize().multiplyScalar(radiusDiff * layer.stiffness);
                    this.velocity.add(restoreForce);
                }
                
                // 熱運動枩床に比䟋
                const thermalNoise = this.temperature / 200;
                this.velocity.add(new THREE.Vector3(
                    (Math.random() - 0.5) * thermalNoise,
                    (Math.random() - 0.5) * thermalNoise,
                    (Math.random() - 0.5) * thermalNoise
                ));
                
                // 感情力を远加
                this.velocity.add(emotionForce);
                
                // 枛衰
                this.velocity.multiplyScalar(layer.damping);
                
                // 速床制限
                const speed = this.velocity.length();
                if (speed > layer.maxSpeed) {
                    this.velocity.normalize().multiplyScalar(layer.maxSpeed);
                }
                
                // 䜍眮曎新
                this.position.add(this.velocity.clone().multiplyScalar(layer.updateRate));
                
                // 感情倀の緩やかな倉化
                this.emotion[0] += (Math.random() - 0.5) * 0.02;
                this.emotion[1] += (Math.random() - 0.5) * 0.02;
                this.emotion[2] += (Math.random() - 0.5) * 0.02;
                this.emotion = this.emotion.map(e => Math.max(-1, Math.min(1, e)));
                
                // メッシュ䜍眮を曎新
                this.mesh.position.copy(this.position);
                
                // 色を枩床に応じお倉曎
                this.updateColor();
            }
            
            updateColor() {
                const tempFactor = Math.min(1, this.temperature / 100);
                
                // 基本色から枩床で赀くシフト
                const baseColor = new THREE.Color(this.layer.color);
                const hotColor = new THREE.Color(0xff3333);
                
                const finalColor = baseColor.clone().lerp(hotColor, tempFactor);
                this.mesh.material.color = finalColor;
                
                // サむズも枩床で倉化
                const scale = 1 + tempFactor * 0.5;
                this.mesh.scale.set(scale, scale, scale);
            }
        }

        let isDragging = false;
        let previousMousePosition = { x: 0, y: 0 };
        const rotationSpeed = 0.01;

        function init() {
            scene = new THREE.Scene();
            scene.background = new THREE.Color(0x1a1a2e);

            camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
            camera.position.z = 20;

            renderer = new THREE.WebGLRenderer({ antialias: true });
            renderer.setSize(window.innerWidth, window.innerHeight);
            document.getElementById('container').appendChild(renderer.domElement);

            const ambientLight = new THREE.AmbientLight(0x404040, 2);
            scene.add(ambientLight);
            
            setupLayerMeshes();
            setupParticles();
            setupMouseControls();
            setupButtons();

            window.addEventListener('resize', onWindowResize, false);
        }

        function setupLayerMeshes() {
            layerMeshes.forEach(mesh => {
                scene.remove(mesh);
                mesh.geometry.dispose();
                mesh.material.dispose();
            });
            layerMeshes = [];

            layers.forEach(layer => {
                const geometry = new THREE.IcosahedronGeometry(layer.radius, 2);
                const material = new THREE.MeshBasicMaterial({
                    color: layer.color,
                    wireframe: true,
                    transparent: true,
                    opacity: 0.3,
                    depthWrite: false,
                    side: THREE.FrontSide
                });
                
                const mesh = new THREE.Mesh(geometry, material);
                scene.add(mesh);
                layerMeshes.push(mesh);
            });
        }
        
        function setupParticles() {
            particles.forEach(p => {
                scene.remove(p.mesh);
                p.mesh.geometry.dispose();
                p.mesh.material.dispose();
            });
            particles = [];
            
            // 各局に1぀ず぀粒子を配眮
            layers.forEach((layer, index) => {
                particles.push(new Particle(layer, index));
            });
        }

        function onWindowResize() {
            camera.aspect = window.innerWidth / window.innerHeight;
            camera.updateProjectionMatrix();
            renderer.setSize(window.innerWidth, window.innerHeight);
        }

        let lastTime = Date.now();

        function animate() {
            requestAnimationFrame(animate);
            
            const now = Date.now();
            const dt = Math.min((now - lastTime) / 1000, 0.1);
            lastTime = now;
            
            if (isRunning) {
                // 圧力蚈算
                particles.forEach(p => p.calculatePressure(particles));
                
                // 粒子曎新
                particles.forEach(p => p.update(dt, particles));
                
                // 統蚈衚瀺
                updateStats();
            }
            
            renderer.render(scene, camera);
        }
        
        function updateStats() {
            const avgTemp = particles.reduce((sum, p) => sum + p.temperature, 0) / particles.length;
            const avgPress = particles.reduce((sum, p) => sum + p.pressure, 0) / particles.length;
            document.getElementById('statsText').textContent = 
                `枩床: ${avgTemp.toFixed(1)} / 圧力: ${avgPress.toFixed(2)}`;
        }

        function setupMouseControls() {
            const container = document.getElementById('container');
            
            const handleMove = (clientX, clientY) => {
                if (!isDragging) return;

                const deltaX = clientX - previousMousePosition.x;
                const deltaY = clientY - previousMousePosition.y;

                scene.rotation.y += deltaX * rotationSpeed;
                scene.rotation.x += deltaY * rotationSpeed;
                scene.rotation.x = Math.max(-Math.PI / 2, Math.min(Math.PI / 2, scene.rotation.x));
                
                previousMousePosition.x = clientX;
                previousMousePosition.y = clientY;
            };

            container.addEventListener('mousedown', (e) => {
                isDragging = true;
                previousMousePosition.x = e.clientX;
                previousMousePosition.y = e.clientY;
            });
            container.addEventListener('mousemove', (e) => handleMove(e.clientX, e.clientY));
            container.addEventListener('mouseup', () => { isDragging = false; });
            container.addEventListener('mouseleave', () => { isDragging = false; });

            container.addEventListener('touchstart', (e) => {
                if (e.touches.length === 1) {
                    isDragging = true;
                    previousMousePosition.x = e.touches[0].clientX;
                    previousMousePosition.y = e.touches[0].clientY;
                }
            }, { passive: false });
            
            container.addEventListener('touchmove', (e) => {
                if (!isDragging || e.touches.length !== 1) return;
                e.preventDefault();
                handleMove(e.touches[0].clientX, e.touches[0].clientY);
            }, { passive: false });

            container.addEventListener('touchend', () => { isDragging = false; }, false);
        }
        
        function setupButtons() {
            document.getElementById('toggleBtn').addEventListener('click', () => {
                isRunning = !isRunning;
                document.getElementById('toggleBtn').innerHTML = isRunning ? '⏞ 停止' : '▶ 再生';
            });
            
            document.getElementById('resetBtn').addEventListener('click', () => {
                scene.rotation.set(0, 0, 0);
                setupParticles();
            });
        }

        window.onload = function () {
            init();
            animate();
        }
    </script>
</body>
</html>

https://g.co/gemini/share/6b81cc72c32d


改蚂版

ChatGPTで線集しおから
Geminiで修正しお衚瀺
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>感情球䜓モデル地平面反発ポテンシャル版</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
    <style>
        /* グロヌバルスタむルずフォント */
        body { 
            margin: 0; 
            overflow: hidden; 
            background: #0b0b1a; 
            color: #e5e5f7; 
            font-family: 'Inter', sans-serif; 
        }
        #container { width: 100vw; height: 100vh; }
        
        /* オヌバヌレむUIのコンテナ */
        #overlay-container {
            position: absolute; 
            top: 0; 
            left: 0; 
            z-index: 10;
            transition: transform 0.3s ease-in-out;
        }

        /* オヌバヌレむUI本䜓 */
        #overlay {
            padding: 1rem;
            color: white; 
            background: rgba(17, 24, 39, 0.9); /* 濃い背景 */
            border-radius: 0 0.5rem 0.5rem 0;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
            max-width: 90vw;
            width: 300px; /* PCでの固定幅 */
        }
        
        /* 非衚瀺時の状態 */
        #overlay-container.hidden {
            transform: translateX(calc(-100% + 40px)); /* ボタン幅だけ残しお巊にスラむド */
        }

        /* トグルボタン */
        #toggle-button {
            position: absolute;
            right: -40px; /* パネルの倖偎に配眮 */
            top: 0;
            width: 40px;
            height: 40px;
            background: rgba(17, 24, 39, 0.9);
            color: white;
            border: none;
            border-radius: 0 0.5rem 0.5rem 0;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.5);
        }
        #toggle-button:hover { background: rgba(17, 24, 39, 1); }

        /* ボタン共通スタむル */
        .emotion-button {
            transition: all 0.2s;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
            font-weight: bold;
        }
        .emotion-button:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }
        .emotion-button.active {
            filter: brightness(1.2);
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
        }
    </style>
</head>
<body>
    <div id="container"></div>
    <div id="overlay-container">
        <button id="toggle-button" aria-expanded="true">
            <span id="toggle-icon">❮</span>
        </button>

        <div id="overlay">
            <h1 class="text-xl font-extrabold text-indigo-400">感情球䜓モデル</h1>
            <p class="text-sm mt-1 text-gray-300">
                **【地平面反発ポテンシャル版】** 内局の地平面が倖局の粒子を抌し広げたす。<br>
                <span class="text-xs text-gray-500">ドラッグ/スワむプで芖点操䜜が可胜です。</span>
            </p>

            <!-- 倖郚Gコントロヌルボタン -->
            <div class="mt-4">
                <h2 class="text-md font-semibold mb-2 text-gray-100">倖郚感情圧力 (External G)</h2>
                <div id="emotion-controls" class="flex flex-wrap gap-2">
                    <button id="joy" class="emotion-button bg-pink-500 text-white px-3 py-1 rounded-lg">喜 (Joy)</button>
                    <button id="anger" class="emotion-button bg-red-600 text-white px-3 py-1 rounded-lg">怒 (Anger)</button>
                    <button id="sadness" class="emotion-button bg-blue-600 text-white px-3 py-1 rounded-lg">哀 (Sadness)</button>
                    <button id="calm" class="emotion-button bg-green-600 text-white px-3 py-1 rounded-lg active">楜 (Calm)</button>
                </div>
            </div>

            <!-- 粒子特性凡䟋 -->
            <div class="mt-4 space-y-2">
                <h2 class="text-md font-semibold text-gray-100">粒子の熱力孊的特性</h2>
                <div class="flex items-center space-x-2 text-red-300">
                    <span class="font-bold w-12">熱い粒子:</span>
                    <span class="text-xs">匷い匕力/匱い斥力収束傟向</span>
                </div>
                <div class="flex items-center space-x-2 text-blue-300">
                    <span class="font-bold w-12">冷めた粒子:</span>
                    <span class="text-xs">匱い匕力/匷い斥力拡散傟向</span>
                </div>
                <div class="flex items-center space-x-2 text-green-300">
                    <span class="font-bold w-12">䞭庞の粒子:</span>
                    <span class="text-xs">匕力ず斥力の均衡安定傟向</span>
                </div>
            </div>
            <p class="text-xs mt-3 text-yellow-300">
                **熱力孊:** 粒子が密集するず<span class="text-white">癜く茝き高圧</span>、その**熱**が党局の境界埩元力に圱響し、動きが掻発化したす。
            </p>
        </div>
    </div>

    <script>
    // Three.jsずシミュレヌションのグロヌバル倉数
    let scene, camera, renderer, systemCore, particles = [];
    let isRunning = true;
    let isDragging = false;
    let previousMousePosition = { x: 0, y: 0 };
    let globalNucleusHeat = 0.0; // 栞局の平均枩床グロヌバルG-Force

    // 物理シミュレヌションの基本定数
    const SIMULATION_DT = 0.08; 
    const PARTICLE_SIZE = 0.2; 
    
    // === 熱力孊定数 ===
    const PRESSURE_RADIUS = 1.0; 
    const MAX_PRESSURE_COUNT = 3; 
    const HOT_COLOR = new THREE.Color(0xffffff); 
    const MAX_HEAT_EFFECT = 1.5; 

    // === 地平面反発定数 ===
    const BOUNDARY_REPULSION_STRENGTH = 0.3; // 地平面からの基本斥力匷床
    const BOUNDARY_REPULSION_RANGE = 0.8; // 地平面の反発ポテンシャルが働く距離粒子埄の4倍

    // === 粒子の個別特性定矩 ===
    const PARTICLE_TYPES = [
        // 0: 熱い粒子 (匷い匕力/匱い斥力) - 収束/熱
        { typeName: "Hot", attFactor: 1.5, repFactor: 0.5, jitterFactor: 1.2 },
        // 1: 冷めた粒子 (匱い匕力/匷い斥力) - 拡散/冷
        { typeName: "Cold", attFactor: 0.5, repFactor: 1.5, jitterFactor: 0.8 }, 
        // 2: 䞭庞の粒子 (均衡) - 平衡
        { typeName: "Neutral", attFactor: 1.0, repFactor: 1.0, jitterFactor: 1.0 }
    ];

    // === 感情的圧力のグロヌバル状態 ===
    let currentEmotionPressure = 'calm'; 

    // 感情ごずの圧力蚭定 (1.0が基本倀)
    const EMOTION_SETTINGS = {
        'joy': { friction_factor: 0.85, speed_factor: 1.3, attraction_factor: 0.9, repulsion_factor: 0.8 }, 
        'anger': { friction_factor: 0.95, speed_factor: 1.1, attraction_factor: 0.8, repulsion_factor: 2.5 }, 
        'sadness': { friction_factor: 1.1, speed_factor: 0.7, attraction_factor: 1.5, repulsion_factor: 0.7 }, 
        'calm': { friction_factor: 1.0, speed_factor: 1.0, attraction_factor: 1.0, repulsion_factor: 1.0 }
    };

    // === 盞互䜜甚定数 ===
    const INTER_LAYER_ATTRACTION_FACTOR = 0.3; 
    const BASE_INTER_LAYER_REPULSION_STRENGTH = 0.02; 
    const BASE_EXTERNAL_G_REPULSION = 0.015; 
    const REPULSION_POWER = 2.5; 
    const REBOUND_VELOCITY_SCALE = 2.0; 

    // 各局の基本定矩
    const layers = [
        // æ žå±€ (0) - 光䜓/最速
        { radius: 2.5, color: 0xffc107, name: "æ žå±€", maxSpeed: 1.0, baseFriction: 0.978, centerAttraction: 0.35, tangentialSpeed: 0.7, longRangeAttraction: 0.06, attractionRange: 3.0, restitution: 0.75, boundaryRepulsion: 0.0 }, // 栞局は内偎地平面なし
        // 身䜓局 (1) - 気䜓/流動
        { radius: 4.5, color: 0x64b5f6, name: "身䜓局", maxSpeed: 0.75, baseFriction: 0.98, centerAttraction: 0.20, tangentialSpeed: 0.5, longRangeAttraction: 0.04, attractionRange: 4.0, restitution: 0.55, boundaryRepulsion: 1.0 }, // 匷く反発
        // 思考局 (2) - 液䜓/埪環
        { radius: 7.0, color: 0x81c784, name: "思考局", maxSpeed: 0.55, baseFriction: 0.983, centerAttraction: 0.12, tangentialSpeed: 0.35, longRangeAttraction: 0.03, attractionRange: 5.0, restitution: 0.35, boundaryRepulsion: 0.8 }, 
        // 文明局 (3) - 固䜓/安定
        { radius: 9.5, color: 0x9e9e9e, name: "文明局", maxSpeed: 0.4, baseFriction: 0.988, centerAttraction: 0.06, tangentialSpeed: 0.25, longRangeAttraction: 0.02, attractionRange: 6.0, restitution: 0.15, boundaryRepulsion: 0.6 }
    ];

    function randomVector(scale = 1) {
        return new THREE.Vector3(
            (Math.random() - 0.5) * scale,
            (Math.random() - 0.5) * scale,
            (Math.random() - 0.5) * scale
        );
    }

    function randomOrbitalPoint(maxR, minR = 0, tangentialSpeed) {
        const r = minR + Math.random() * (maxR - minR); 
        const theta = Math.random() * Math.PI * 2;
        const phi = Math.acos(2 * Math.random() - 1); 
        
        const position = new THREE.Vector3(
            r * Math.sin(phi) * Math.cos(theta),
            r * Math.sin(phi) * Math.sin(theta),
            r * Math.cos(phi)
        );

        const radialDirection = position.clone().normalize();
        let tangentialDirection = new THREE.Vector3().crossVectors(radialDirection, randomVector(1)).normalize();
        
        const orbitalVelocity = tangentialDirection.multiplyScalar(tangentialSpeed);
        const randomInitialVelocity = randomVector(tangentialSpeed * 0.3); 
        
        const velocity = orbitalVelocity.add(randomInitialVelocity);
        
        return { position, velocity };
    }

    function createSphere(color, size) {
        const geo = new THREE.SphereGeometry(size, 16, 16);
        const mat = new THREE.MeshLambertMaterial({ color, transparent: true, opacity: 0.9, shininess: 80 }); 
        return new THREE.Mesh(geo, mat);
    }
    
    const tempVector = new THREE.Vector3();
    const tempColor = new THREE.Color();

    function handleParticleCollision(p1, p2) {
        if (p1.layerIndex !== p2.layerIndex) return;

        const requiredDistance = PARTICLE_SIZE * 2;
        const diff = p1.position.clone().sub(p2.position);
        const dist = diff.length();

        if (dist < requiredDistance && dist > 0.001) {
            const penetrationDepth = requiredDistance - dist;
            const normal = diff.normalize();
            
            p1.position.addScaledVector(normal, penetrationDepth * 0.5);
            p2.position.addScaledVector(normal, -penetrationDepth * 0.5);

            const v1 = p1.velocity;
            const v2 = p2.velocity;

            const v1_normal = v1.dot(normal);
            const v2_normal = v2.dot(normal);
            
            const vp = (v1_normal + v2_normal) / 2;
            const rest = p1.layer.restitution; 
            
            const v1f_normal = vp + (v2_normal - v1_normal) * rest * REBOUND_VELOCITY_SCALE; 
            const v2f_normal = vp + (v1_normal - v2_normal) * rest * REBOUND_VELOCITY_SCALE;

            v1.addScaledVector(normal, v1f_normal - v1_normal);
            v2.addScaledVector(normal, v2f_normal - v2_normal);
        }
    }

    class Particle {
        constructor(layer, layerIndex, j) { 
            this.layer = layer;
            this.layerIndex = layerIndex;
            this.particleIndexInLayer = j;
            this.type = PARTICLE_TYPES[j % 3]; 
            this.baseColor = new THREE.Color(layer.color); 
            this.temperature = 0.0; 
            
            const innerR = (layerIndex === 0) ? 0.0 : layers[layerIndex - 1].radius;
            const outerR = layers[layerIndex].radius;
            const initial = randomOrbitalPoint(outerR - PARTICLE_SIZE, innerR + PARTICLE_SIZE, layer.tangentialSpeed);

            this.position = initial.position;
            this.velocity = initial.velocity;
            
            let initialColor = this.baseColor.clone();
            if (this.type.typeName === "Hot") { initialColor.lerp(new THREE.Color(0xff8888), 0.1); } 
            else if (this.type.typeName === "Cold") { initialColor.lerp(new THREE.Color(0x8888ff), 0.1); }
            
            this.mesh = createSphere(initialColor.getHex(), PARTICLE_SIZE);
            this.mesh.position.copy(this.position);
            systemCore.add(this.mesh);
        }

        update(dt, allParticles) {
            const pressure = EMOTION_SETTINGS[currentEmotionPressure];
            const pType = this.type;
            
            // === 1. 動的パラメヌタ調敎 ===
            const dynamicFriction = this.layer.baseFriction * pressure.friction_factor;
            const dynamicMaxSpeed = this.layer.maxSpeed * pressure.speed_factor;
            
            const dynamicCenterAttraction = this.layer.centerAttraction * pressure.attraction_factor * pType.attFactor;
            const dynamicBaseRepulsionStrength = BASE_INTER_LAYER_REPULSION_STRENGTH * pressure.repulsion_factor * pType.repFactor;
            const dynamicLongRangeAttraction = this.layer.longRangeAttraction * pressure.attraction_factor * pType.attFactor;

            // 2. 感情的揺らぎ
            this.velocity.add(randomVector(this.layer.maxSpeed * 0.05 * dt * pType.jitterFactor)); 

            // 3. 粒子間の盞互䜜甚
            let interactionForce = new THREE.Vector3();
            const attractionRange = this.layer.attractionRange;
            
            for (const other of allParticles) {
                if (other === this) continue;
                
                const diff = tempVector.subVectors(other.position, this.position);
                const dist = diff.length();
                
                if (dist > 0.001 && dist < attractionRange) { 
                    diff.normalize();
                    
                    let forceMagnitude = 0;
                    
                    const repulsion = dynamicBaseRepulsionStrength / Math.pow(dist, REPULSION_POWER);
                    
                    if (this.layerIndex === other.layerIndex) {
                        const attraction = dynamicLongRangeAttraction / dist;
                        forceMagnitude = attraction - repulsion;
                    } else {
                        const interAttraction = (dynamicLongRangeAttraction / dist) * INTER_LAYER_ATTRACTION_FACTOR;
                        forceMagnitude = interAttraction - repulsion;
                    }

                    interactionForce.add(diff.multiplyScalar(forceMagnitude));
                }
            }
            this.velocity.add(interactionForce.multiplyScalar(dt));

            // 4. 文明局固䜓に倖郚G斥力を適甚
            if (this.layerIndex === layers.length - 1) {
                const externalRepulsion = randomVector(BASE_EXTERNAL_G_REPULSION * pressure.repulsion_factor * dt);
                this.velocity.add(externalRepulsion);
            }

            // 5. 䞭心匕力哀しみ・収束
            const radius = this.position.length();
            const centerDirection = this.position.clone().negate().normalize();
            const attractionStrength = dynamicCenterAttraction / (radius * radius + 0.1); 
            this.velocity.add(centerDirection.multiplyScalar(attractionStrength * dt));

            // 6. 速床制限ず摩擊
            const spd = this.velocity.length();
            if (spd > dynamicMaxSpeed) {
                this.velocity.normalize().multiplyScalar(dynamicMaxSpeed);
            }
            this.velocity.multiplyScalar(dynamicFriction); 
            
            // 7. 地平面からの反発ポテンシャル内偎境界からの抌し広げ
            if (this.layerIndex > 0) {
                const innerBoundaryRadius = layers[this.layerIndex - 1].radius + PARTICLE_SIZE;
                const distToInnerBoundary = radius - innerBoundaryRadius;
                
                if (distToInnerBoundary < BOUNDARY_REPULSION_RANGE) {
                    const repulsionStrength = this.layer.boundaryRepulsion * BOUNDARY_REPULSION_STRENGTH;
                    // 距離が近づくほど斥力は匷くなる非線圢
                    const repulsionMagnitude = repulsionStrength / (distToInnerBoundary * distToInnerBoundary + 0.01);
                    
                    const normalOutward = this.position.clone().normalize();
                    this.velocity.add(normalOutward.multiplyScalar(repulsionMagnitude * dt));
                }
            }


            this.position.add(this.velocity.clone().multiplyScalar(dt));

            // 8. ハヌド境界チェックず䜍眮補正 (G-Force連鎖適甚)
            const newRadius = this.position.length();
            
            // *** G-Force連鎖: 栞局の平均熱を党局の埩元力に乗算 ***
            const heatFactor = 1.0 + (globalNucleusHeat * (MAX_HEAT_EFFECT - 1.0)); 
            const restitution = this.layer.restitution * heatFactor; 

            const innerBoundary = (this.layerIndex === 0) ? 0.0 : layers[this.layerIndex - 1].radius + PARTICLE_SIZE;
            const outerBoundary = layers[this.layerIndex].radius - PARTICLE_SIZE;

            if (newRadius > outerBoundary) {
                const normal = this.position.clone().normalize();
                this.position.copy(normal.multiplyScalar(outerBoundary)); 
                this.velocity.reflect(normal).multiplyScalar(restitution); 
            } else if (newRadius < innerBoundary) {
                const normal = this.position.clone().negate().normalize(); 
                this.position.copy(this.position.normalize().multiplyScalar(innerBoundary));
                this.velocity.reflect(normal).multiplyScalar(restitution);
            }

            this.mesh.position.copy(this.position);
            
            // === 9. 熱力孊: 粒子の枩床圧力/集䞭床蚈算ず色の曎新 ===
            let neighborCount = 0;
            for (const other of allParticles) {
                if (other === this) continue;
                const dist = this.position.distanceTo(other.position);
                if (dist < PRESSURE_RADIUS) { 
                    neighborCount++;
                }
            }
            
            this.temperature = Math.min(1.0, neighborCount / MAX_PRESSURE_COUNT); 
            
            const heatSensitivity = (pType.attFactor * 0.5) + 0.5; 
            this.mesh.material.color.copy(this.baseColor).lerp(HOT_COLOR, this.temperature * heatSensitivity * 0.7); 
        }
    }

    class SystemCore extends THREE.Object3D {
        constructor() {
            super();
            this.velocity = randomVector(0.01); 
        }
        update(dt) {
            this.position.add(this.velocity.clone().multiplyScalar(dt * 0.1)); 
            const drift = randomVector(0.001);
            this.velocity.add(drift);
            const centerForce = this.position.clone().negate().multiplyScalar(0.005);
            this.velocity.add(centerForce.multiplyScalar(dt));
            
            if (this.velocity.length() > 0.1) {
                this.velocity.normalize().multiplyScalar(0.1);
            }
        }
    }

    // === グロヌバルG-Forceの蚈算 ===
    function calculateGlobalNucleusHeat() {
        let totalHeat = 0;
        let nucleusParticleCount = 0;
        
        for (const p of particles) {
            if (p.layerIndex === 0) { // 栞局のむンデックスは 0
                totalHeat += p.temperature;
                nucleusParticleCount++;
            }
        }
        
        if (nucleusParticleCount > 0) {
            globalNucleusHeat = totalHeat / nucleusParticleCount;
        } else {
            globalNucleusHeat = 0.0;
        }
    }

    function init() {
        scene = new THREE.Scene();
        camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
        camera.position.z = 25;
        const pointLight = new THREE.PointLight(0xffffff, 2.5);
        pointLight.position.set(5, 5, 5);
        scene.add(pointLight);

        scene.add(new THREE.AmbientLight(0xffffff, 0.5)); 
        
        renderer = new THREE.WebGLRenderer({ antialias: true });
        renderer.setSize(window.innerWidth, window.innerHeight);
        document.getElementById("container").appendChild(renderer.domElement);
        
        systemCore = new SystemCore();
        scene.add(systemCore);

        layers.forEach(layer => {
            const mesh = new THREE.Mesh(
                new THREE.IcosahedronGeometry(layer.radius, 2), 
                new THREE.MeshBasicMaterial({ color: layer.color, wireframe: true, opacity: 0.15, transparent: true, depthWrite: false })
            );
            systemCore.add(mesh);
        });

        layers.forEach((layer, idx) => {
            for (let j = 0; j < 3; j++) {
                particles.push(new Particle(layer, idx, j)); 
            }
        });

        setupEventListeners();
        setupEmotionControls();
        setupToggleUI(); 
        animate();
    }
    
    function setupEventListeners() {
        window.addEventListener('resize', () => {
            camera.aspect = window.innerWidth / window.innerHeight;
            camera.updateProjectionMatrix();
            renderer.setSize(window.innerWidth, window.innerHeight);
        });
        
        const handleInteractionStart = (clientX, clientY) => {
            isDragging = true;
            previousMousePosition = { x: clientX, y: clientY };
            document.body.style.cursor = 'grabbing';
        };

        const handleInteractionMove = (clientX, clientY) => {
            if (!isDragging) return;
            const deltaX = clientX - previousMousePosition.x;
            const deltaY = clientY - previousMousePosition.y;
            const rotationSpeed = 0.008; 
            systemCore.rotation.y += deltaX * rotationSpeed;
            systemCore.rotation.x += deltaY * rotationSpeed;
            previousMousePosition = { x: clientX, y: clientY };
        };

        const handleInteractionEnd = () => {
            isDragging = false;
            document.body.style.cursor = 'grab';
        };

        renderer.domElement.addEventListener('mousedown', (e) => { handleInteractionStart(e.clientX, e.clientY); });
        document.addEventListener('mousemove', (e) => { handleInteractionMove(e.clientX, e.clientY); });
        document.addEventListener('mouseup', handleInteractionEnd);
        
        renderer.domElement.addEventListener('touchstart', (e) => {
            e.preventDefault(); 
            const touch = e.touches[0];
            handleInteractionStart(touch.clientX, touch.clientY);
        });
        renderer.domElement.addEventListener('touchmove', (e) => {
            e.preventDefault();
            const touch = e.touches[0];
            handleInteractionMove(touch.clientX, touch.clientY);
        });
        renderer.domElement.addEventListener('touchend', handleInteractionEnd);
        document.body.style.cursor = 'grab';
    }

    function setupEmotionControls() {
        const controls = document.getElementById('emotion-controls');
        const buttons = controls.querySelectorAll('.emotion-button');
        
        buttons.forEach(button => {
            button.addEventListener('click', () => {
                const newEmotion = button.id;
                
                currentEmotionPressure = newEmotion;
                
                buttons.forEach(btn => btn.classList.remove('active'));
                button.classList.add('active');
            });
        });
    }

    /**
     * UIパネルの開閉機胜
     */
    function setupToggleUI() {
        const container = document.getElementById('overlay-container');
        const button = document.getElementById('toggle-button');
        const icon = document.getElementById('toggle-icon');

        button.addEventListener('click', () => {
            const isCurrentlyHidden = container.classList.contains('hidden');
            
            container.classList.toggle('hidden'); 
            icon.textContent = isCurrentlyHidden ? '❮' : '❯';
            button.setAttribute('aria-expanded', isCurrentlyHidden);
        });

        container.classList.remove('hidden');
    }

    function animate() {
        requestAnimationFrame(animate);
        
        const dt = SIMULATION_DT; 
        
        if (isRunning) {
            calculateGlobalNucleusHeat(); 
            
            particles.forEach(p => p.update(dt, particles));
            
            for (let i = 0; i < particles.length; i++) {
                for (let j = i + 1; j < particles.length; j++) {
                    if (particles[i].layerIndex === particles[j].layerIndex) {
                        handleParticleCollision(particles[i], particles[j]);
                    }
                }
            }

            systemCore.update(dt);
            
            if (!isDragging) {
                systemCore.rotation.y += 0.001; 
            }
        }
        
        renderer.render(scene, camera);
    }

    window.onload = init;
    </script>
</body>
</html>

ここから先は

24,371字
この蚘事のみ Â¥ 500〜
Amazon Payで支払うず最倧2%還元のチャンス 9/30たで

ふぃろずnoteでワむワむガダガダいろんな実隓しながら楜しく過ごすサヌクルです♪【初心者倧歓迎】はD


Hello World And Friends♡䌑憩所♡

¥100 / 月
1ヶ月無料

䞖界は䞀぀に統䞀できる すべおの孊問は 䞀぀の抂念から生たれおいる 私はそう信じおいたす♪ もし同じ気持ちならば賌入の前に 共同運営者になりたせんか

感情ずは 量子力孊、熱力孊、芒星 ありずあらゆる孊問の最終圢態を目指しお 人工知胜の基瀎ずなる感情の数倀化ずは

Amazon Payで支払うず最倧2%還元のチャンス 9/30たで
これたで私が経隓しおきた数々のなんだかんだを栌玍しおいるコラム集です♪ 賌入頂くず曎新情報が届きたすので よろしければお䞀぀劂䜕でしょうか♪

オレの経隓談

Amazon Payで支払うず最倧2%還元のチャンス 9/30たで

い぀もサポヌトありがずうございたす♪ 苊情やメッセヌゞなどありたしたらご遠慮無く↓ぞ https://note.mu/otspace0715/message