<commit_before><?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:webgl="http://www.xml3d.org/2009/xml3d/webgl">
<head>
  <title>TrackBall</title>
  <link rel="stylesheet" type="text/css" media="all" href="../../style/default.css" />

  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
  <script type="text/javascript" src="../../external/xml3d.js"></script>
  <script type="text/javascript" src="../../../build/output/xml3d.tools.js"></script>
  <script type="text/javascript" src="../page.js" />

  <script type="text/javascript" src="test_trackball.js"></script>
</head>

<body onload="initScene()">
<div id="overall">
    <div id="content">
  <h1>TrackBall</h1>
  <div style="padding: 16px" >
    <div id="Xml3dWrapper" style="color: red" >
      <xml3d id="MyXml3d"
        xmlns="http://www.xml3d.org/2009/xml3d"
        xmlns:xlink="http://www.w3.org/1999/xlink"
        webgl:showLog="false"
        activeView="#controller_view"
        pickableBackground="true"
        style="width:350px; height:350px;"
      >
          <view id="controller_view" position="0 0 10" />
          <light id="light1" intensity="10.8" global="false" />

          <defs>
            <data id="mySimpleMesh">
              <int name="index">0 1 2 1 2 3</int>
              <float3 name="position">
               -1.0 -1.0 -0.0
                1.0 -1.0 -0.0
               -1.0  1.0 -0.0
                1.0  1.0 -0.0
              </float3>
              <float3 name="normal">
                0.0 0.0 1.0
                0.0 0.0 1.0
                0.0 0.0 1.0
                0.0 0.0 1.0
              </float3>
              <float2 name="texcoord">
                0.0 1.0
                1.0 1.0
                0.0 0.0
                1.0 0.0
              </float2>
            </data>

            <transform id="t_target" />
            <transform id="transall" />
          </defs>

          <group id="group_all" transform="#transall">
            <group id="g_target" transform="#t_target">
              <mesh id="mesh_group1" type="triangles" src="#mySimpleMesh" />
            </group>
          </group>
      </xml3d>
    </div>
  </div>

  <!-- enable key handling of scene controller -->
  <div id="useKeys" />

  <div class="actions">
    <input type="button" value="Activate Trackball" id="toggletrackball" onclick="toggleTrackBall();" />
    <input type="button" value="Reset Rotation" onclick="resetRotation();" />
  </div>

  <div class="message">
    <p>Upon activation the rotation of the rectangle can be controlled by dragging it.
    This is done using a TrackBall.</p>

    <p>A TrackBall delivers the rotation behavior given a mouse position. It is
    the base class for the Rotater.</p>

    <p>The status can be reviewed below.
      <ul>
        <li><b>Dragging:</b> whether the mouse is dragging and thus rotating.</li>
        <li><b>Rotation:</b> the rotation attribute of the target element's transform node.</li>
      </ul>
    </p>

    <p>If a TrackBall is attached, the rotation can be reset to the state
    before the manipulation. This behavior can be tested using the corresponding
    button above.</p>
  </div>

  <div class="message">
    Dragging: <span id="dragstatus">false</span>
  </div>
  <div class="message">Rotation: <span id="rotation">no dragging done yet</span></div>
    </div>
  </div>
</body>
</html><commit_msg>polished trackball<commit_after><?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:webgl="http://www.xml3d.org/2009/xml3d/webgl">
<head>
    <title>TrackBall</title>
    <link rel="stylesheet" type="text/css" media="all" href="../../style/default.css"/>

    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    <script type="text/javascript" src="../../external/xml3d.js"></script>
    <script type="text/javascript" src="../../../build/output/xml3d.tools.js"></script>
    <script type="text/javascript" src="../page.js"/>

    <script type="text/javascript" src="test_trackball.js"></script>
</head>

<body onload="initScene()">
<div id="overall">
    <div id="content">
        <h1>TrackBall</h1>

        <xml3d id="MyXml3d"
               xmlns="http://www.xml3d.org/2009/xml3d"
               activeView="#controller_view"
               style="width:350px; height:350px;"
        >
            <view id="controller_view" position="0 0 10"/>

            <defs>
                <data id="mySimpleMesh">
                    <int name="index">0 1 2 1 2 3</int>
                    <float3 name="position">
                        -1.0 -1.0 -0.0
                        1.0 -1.0 -0.0
                        -1.0 1.0 -0.0
                        1.0 1.0 -0.0
                    </float3>
                    <float3 name="normal">
                        0.0 0.0 1.0
                        0.0 0.0 1.0
                        0.0 0.0 1.0
                        0.0 0.0 1.0
                    </float3>
                    <float2 name="texcoord">
                        0.0 1.0
                        1.0 1.0
                        0.0 0.0
                        1.0 0.0
                    </float2>
                </data>

                <transform id="t_target"/>
                <transform id="transall"/>
            </defs>

            <group id="group_all" transform="#transall">
                <group id="g_target" transform="#t_target">
                    <mesh id="mesh_group1" type="triangles" src="#mySimpleMesh"/>
                </group>
            </group>
        </xml3d>

        <div class="actions">
            <input type="button" class="test-button" value="Activate Trackball" id="toggletrackball" onclick="toggleTrackBall();"/>
            <input type="button" class="test-button" value="Reset Rotation" onclick="resetRotation();"/>
        </div>

        <div class="description">
            <div class="paragraph">
                Upon activation the rotation of the rectangle can be controlled by dragging it.
                This is done using a TrackBall. A TrackBall delivers the rotation behavior given
                a mouse position. It is the base class for the Rotater.
            </div>

            <div class="separator" />

            <div class="paragraph">
                The status can be reviewed below.
                <ul>
                    <li><b>Dragging:</b> whether the mouse is dragging and thus rotating.</li>
                    <li><b>Rotation:</b> the rotation attribute of the target element's transform node.</li>
                </ul>
            </div>
            <div class="paragraph">
                <div><b>Dragging:</b> <span id="dragstatus">false</span></div>
                <div><b>Rotation:</b> <span id="rotation">no dragging done yet</span></div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
{'fraction_non_alphanumeric': 0.16241816408970608, 'fraction_numerical': 0.03593815294609277, 'mean_word_length': 1.7604767397154941, 'pattern_counts': {'":': 0, '<': 173, '<?xml version=': 2, '>': 173, 'https://': 0, 'lorem ipsum': 0, 'www.': 9, 'xml': 25}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4221736', 'n_tokens_mistral': 2365, 'n_tokens_neox': 2176, 'n_words': 505}