Skip to content
TheChatArchiveThe Chat Archive
MiniMaxminimax-m1· MiniMaxHugging Face LMArena Human Preference 140K

よくない まず、Z軸には動かない平行四辺形の計算をして、そこから(親からの距離一定、等距離で追随)の計算をして

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Metallama-3.3-70b-instruct’s answer.
  1. User

    よくない まず、Z軸には動かない平行四辺形の計算をして、そこから(親からの距離一定、等距離で追随)の計算をして

  2. MiniMax Assistant

    了解しました!
    「平行四辺形の計算(Y軸方向)」を最優先で行い、その上で「Z軸方向の距離制約」を満たす方法を実装します。


    ✅ 実装概要

    1. 平行四辺形維持(Y軸方向)

      • A2, B2, C2 の Y 座標が A1, B1, C1 の Y 座標と同じ差分を維持
      • 例: A1.y = g_dist, A2.y = g_dist → B1.y = 0, B2.y = 0 → C1.y = -g_dist, C2.y = -g_dist
    2. Z軸距離制約

      • 各子ヘルパー(A2, B2, C2)が親(A1, B1, C1)から Z 軸方向に g_dist 離れる

    ✅ スクリプト

    (
        delete objects
        
        global g_dist = 20.0
        global g_z    = 10.0
        global g_size = 8.0
        global g_busy = false
    
        /* ---------- ヘルパー生成 ---------- */
        global g_A1 = point name:"A1" pos:[0,  g_dist,  g_z] size:g_size wirecolor:red cross:true
        global g_B1 = point name:"B1" pos:[0,      0,  g_z] size:g_size wirecolor:blue cross:true
        global g_C1 = point name:"C1" pos:[0, -g_dist,  g_z] size:g_size wirecolor:green cross:true
    
        global g_A2 = point name:"A2" pos:[g_dist,  g_dist,  g_z] size:g_size wirecolor:orange cross:true
        global g_B2 = point name:"B2" pos:[g_dist,       0,  g_z] size:g_size wirecolor:yellow cross:true
        global g_C2 = point name:"C2" pos:[g_dist, -g_dist,  g_z] size:g_size wirecolor:(color 0 255 255) cross:true
    
        /* ---------- 親行固定 ---------- */
        for p in #(g_A1,g_B1,g_C1) do p.isFrozen = true
    
        /* ---------- 前回位置記録 ---------- */
        global g_lastA2 = g_A2.pos
        global g_lastB2 = g_B2.pos
        global g_lastC2 = g_C2.pos
    
        /* ---------- ユーティリティ ---------- */
        fn safeNormalize v =
        (
            local L = length v
            if L < 1e-4 then [1,0,0] else v/L
        )
    
        /* ---------- 平行四辺形維持(Y軸方向)---------- */
        fn maintainParallelogramY mover =
        (
            -- Y座標の相対差を計算
            local yOffsetA = g_A2.pos.y - g_A1.pos.y
            local yOffsetB = g_B2.pos.y - g_B1.pos.y
            local yOffsetC = g_C2.pos.y - g_C1.pos.y
    
            -- 他の点のY座標を修正
            if mover == g_A2 then
            (
                g_B2.pos.y = g_B1.pos.y + yOffsetA
                g_C2.pos.y = g_C1.pos.y + yOffsetA
            )
            else if mover == g_B2 then
            (
                g_A2.pos.y = g_A1.pos.y + yOffsetB
                g_C2.pos.y = g_C1.pos.y + yOffsetB
            )
            else if mover == g_C2 then
            (
                g_A2.pos.y = g_A1.pos.y + yOffsetC
                g_B2.pos.y = g_B1.pos.y + yOffsetC
            )
        )
    
        /* ---------- Z軸距離制約 ---------- */
        fn maintainZDistance mover =
        (
            -- 親→子のZ距離をg_distに固定
            local parent = case mover of
            (
                g_A2: g_A1
                g_B2: g_B1
                g_C2: g_C1
            )
            local dir = safeNormalize(mover.pos - parent.pos)
            mover.pos.z = parent.pos.z + dir.z * g_dist
        )
    
        /* ---------- メイン処理 ---------- */
        fn maintainConstraints mover =
        (
            if g_busy do return()
            g_busy = true
            
            try
            (
                -- 1. 平行四辺形維持(Y軸)
                maintainParallelogramY mover
                
                -- 2. Z軸距離制約
                maintainZDistance mover
                
                -- 他の点もZ軸制約を適用
                maintainZDistance (if mover == g_A2 then g_B2 else if mover == g_B2 then g_A2 else g_A2)
                maintainZDistance (if mover == g_A2 then g_C2 else if mover == g_C2 then g_A2 else g_B2)
            )
            catch
            (
                format "Error: %\n" (getCurrentException())
            )
            finally
            (
                g_busy = false
            )
        )
    
        /* ---------- ハンドラ登録 ---------- */
        deleteAllChangeHandlers id:#YFirstZSecond
        when transform g_A2 changes id:#YFirstZSecond do maintainConstraints g_A2
        when transform g_B2 changes id:#YFirstZSecond do maintainConstraints g_B2
        when transform g_C2 changes id:#YFirstZSecond do maintainConstraints g_C2
    
        format "Setup complete: Y軸平行四辺形 → Z軸距離制約\n"
    )
    

    ✅ 計算の流れ

    1. 平行四辺形維持(Y軸方向)

      • 動かした点の Y 座標と親の Y 座標の差分(yOffset)を計算
      • 他の点の Y 座標も同じ差分になるように修正
      • 例: A2 を上に動かす → B2, C2 の Y 座標も同様に上に動く
    2. Z軸距離制約

      • 各子ヘルパーと親の Z 座標の差が g_dist になるように修正
      • 他の点も同様に Z 軸距離を修正(連動)

    ✅ 動作確認

    操作動作
    A2/B2/C2 を Y軸方向にドラッグ他の点も Y 座標が同じ差分になるように追従(平行四辺形維持)
    A2/B2/C2 を Z軸方向にドラッグZ 軸距離が g_dist に保たれる(他の点も Z 軸距離を修正)

    この方法では、Y軸方向の平行四辺形構造が最優先で維持され、その上でZ軸方向の距離制約が適用されます。
    是非お試しください!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.