Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
916 views
in Technique[技术] by (71.8m points)

aframe - A-Frame Super Hands rotate grabbed object

I'm working with A-Frame, A-Frame Physics, and Super Hands. I have a simple scene where I can place an object (just a-box for now) and some controllers. When I view this scene in VR I can grab the box, move it around, and resize it, but I cannot rotate or spin the object.

I want the rotation to match the rotation of the hand that is holding the object. So if I grab an object with my right hand, then turn that hand, the object should rotate the same amount.

<a-scene
      style="height: calc(100vh - 5rem)"
      embedded
      physics="debug: true; gravity: 0;"
    >
      <a-entity>
        <a-camera></a-camera>
        <a-entity
          sphere-collider="objects: a-box"
          super-hands
          hand-controls="hand: left"
        ></a-entity>
        <a-entity
          sphere-collider="objects: a-box"
          super-hands
          hand-controls="hand: right"
        ></a-entity>
      </a-entity>

      <a-box
        color="blue"
        position="0 1.4 -1"
        depth="0.1"
        height="0.8"
        width="1"
        grabbable
        stretchable
        draggable
        dynamic-body
      >
      </a-box>
    </a-scene>```

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...