添加跟随摄像头

发布于 2025-01-13 01:24:28 字数 879 浏览 3 评论 0原文

我想添加跟随相机,当我移动它时它将跟随该物体。由于我使用的是联网 a 框架,因此我的对象位于模板中。

<a-assets>
     <a-asset-item id="bee" src="./bee/scene.gltf"></a-asset-item>
</a-assets>

这是模型。

<template id="bee-template">
        <a-entity
          id="fly"
          gltf-model="#bee"
          animation-mixer="clip: Rig|bee_idle"
          scale="0.02 0.02 0.02"
          look-controls
          wasd-controls
        >
        </a-entity>
</template>

这是我要添加到网络场景中的模板。

<a-entity
        id="model"
        networked="template:#bee-template;attachTemplateToLocal:false;"
        position="0 1 0"
        spawn-in-circle="radius:3"
        wasd-controls="acceleration: 10"
        look-controls
      >
</a-entity>

所以,通过使用这个,我希望相机能够跟随蜜蜂。请帮忙!

I want to add follow camera which will follow the object when I move it. As I am using a networked a-frame so my object is in the template.

<a-assets>
     <a-asset-item id="bee" src="./bee/scene.gltf"></a-asset-item>
</a-assets>

This is model.

<template id="bee-template">
        <a-entity
          id="fly"
          gltf-model="#bee"
          animation-mixer="clip: Rig|bee_idle"
          scale="0.02 0.02 0.02"
          look-controls
          wasd-controls
        >
        </a-entity>
</template>

This is a template that I'm adding to the networked scene.

<a-entity
        id="model"
        networked="template:#bee-template;attachTemplateToLocal:false;"
        position="0 1 0"
        spawn-in-circle="radius:3"
        wasd-controls="acceleration: 10"
        look-controls
      >
</a-entity>

So, by using this I want that camera to follow bee. Please help in this!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文