Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
933 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...