【问题标题】:Camera walks through the wall built in blender相机穿过内置搅拌机的墙壁
【发布时间】:2018-04-25 06:56:43
【问题描述】:

我的相机只是穿过我在 Blender 中建造的房子的内墙。这是我遵循的步骤 -

  1. 在 Blender 中为房子建模。
  2. 应用物理 -> 房屋内外墙的碰撞
  3. 导出为 .obj 和 .mtl 并在 a-frame 中使用
  4. 将摄像头放在屋内。
  5. 虽然摄像机可以通过穿过墙壁从内部走出房屋,但在发生碰撞时无法从外部移回房屋。此外,摄像头可以穿过房屋的所有内墙而不会发生碰撞。
  6. 我不知道如何分享我的搅拌机文件。

这是我的代码 -

<div id="myEmbeddedScene">
    <a-scene raycaster-autorefresh physics embedded="">

        <a-assets>
          <a-asset-item id="house-obj" src="../images/house.obj"></a-asset-item>
          <a-asset-item id="house-mtl" src="../images/house.mtl"></a-asset-item>
          <a-mixin id="checkpoint"></a-mixin>
          <a-mixin id="checkpoint-hovered" color="#6CEEB5"></a-mixin>
        </a-assets>

      <!-- Player -->
        <a-entity camera="userHeight: 0.6"
            universal-controls="movementControls: checkpoint, keyboard"
            checkpoint-controls="mode: animate"
            kinematic-body>
            <a-cursor
                  cursor="fuse: true;"
                  timeout="10"
                  position="0 0.1 -3"
                  geometry="primitive: ring; radiusInner: 0.02; radiusOuter: 0.03;"
                  material="color: #4CC3D9; shader: flat;">
            </a-cursor>
        </a-entity>


        <!-- Ground -->
        <a-grid static-body visible="false"></a-grid>

        <!-- Obstacles -->
        <a-obj-model src="#house-obj" mtl="#house-mtl" scale="0.5 0.5 0.5" rotation="0 0 0" class="clickable" static-body></a-obj-model>




      <!-- Lighting -->
      <a-light type="ambient" color="#bbb"></a-light>
    <!--  <a-light color="#ccc" position="0 30 0" distance="100" intensity="0.4" type="point"></a-light>
      <a-light color="#ccc" position="3 10 -10" distance="50" intensity="0.4" type="point"></a-light> -->

    </a-scene>

</div>

My codepen - https://codepen.io/nirajupadhyay11/pen/ZaGWdN

【问题讨论】:

    标签: physics collision blender aframe


    【解决方案1】:

    https://aframe.io/docs/0.7.0/introduction/faq.html#can-i-prevent-the-camera-from-going-through-obstacles

    对于使用游戏手柄或键盘控件的非 VR 桌面体验,或者对于摄像机位于车内的 VR 场景,您可以添加物理引擎来防止移动穿过障碍物。

    https://github.com/donmccurdy/aframe-physics-system

    【讨论】:

    • 感谢您的评论。这就是我想要实现的目标 - archviz-demo.surge.sh 我尝试在我在 Blender 中构建的模型上应用“刚体”和框架物理,但相机一直穿过房子的内墙。
    猜你喜欢
    • 2020-01-06
    • 1970-01-01
    • 2015-06-13
    • 2016-01-19
    • 2012-11-15
    • 1970-01-01
    • 2012-02-07
    • 2023-02-20
    • 2013-09-11
    相关资源
    最近更新 更多