- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在尝试为场景中的相机旋转设置动画。动画应在注视圆圈 1 秒后出现。
问题是场景的底部在动画之后似乎无法到达,尽管它是在动画发生之前。
我首先尝试为相机设置动画,然后是相机容器。第二个选项产生了另一个问题,似乎所有的天空都被取代了,我不知道如何“纠正”它。
Video of the problem when the animation is on the camera
这里有两个代码笔:
<script src="https://aframe.io/releases/0.6.1/aframe.min.js"></script>
<script src="https://unpkg.com/aframe-animation-component/dist/aframe-animation-component.min.js"></script>
<a-scene>
<a-assets>
<img id="city" src="https://cdn.aframe.io/360-image-gallery-boilerplate/img/city.jpg" data-position="0 0 0" alt="Table de conférence">
</a-assets>
<a-sky src="#city" rotation="0 0 0"></a-sky>
<a-circle position="-8 -5 2"
rotation="90 0 0"
geometry="radius: 1;"
material="side: double;"
>
</a-circle>
<a-entity id="camera-container" rotation="0 100 0">
<a-entity id="camera" look-controls camera="fov: 80; userHeight: 0" wasd-controls="enabled: false;">
<a-animation attribute="rotation"
dur="1000"
begin="animation__fuse-complete"
from="-31.2 4 0"
to="2 5.5 0"
></a-animation>
<a-entity id="cursor" cursor="fuse: true; fuseTimeout: 100"
position="0 0 -1"
geometry="primitive: ring; radiusInner: 0.013; radiusOuter: 0.02"
material="color: #000; shader: flat"
animation__fuse="startEvents: fusing;
property: scale;
dur: 1000;
to: 0.4 0.4 0.4"
animation__fuseed="startEvents: animation__fuse-complete;
property: scale;
dur: 1;
to: 1 1 1"
>
</a-entity>
</a-entity>
</a-entity>
<script src="https://aframe.io/releases/0.6.1/aframe.min.js"></script>
<script src="https://unpkg.com/aframe-animation-component/dist/aframe-animation-component.min.js"></script>
<a-scene>
<a-assets>
<img id="city" src="https://cdn.aframe.io/360-image-gallery-boilerplate/img/city.jpg" data-position="0 0 0" alt="Table de conférence">
</a-assets>
<a-sky src="#city" rotation="0 0 0"></a-sky>
<a-circle position="-8 -5 2"
rotation="90 0 0"
geometry="radius: 1;"
material="side: double;"
>
</a-circle>
<a-entity id="camera-container" rotation="0 100 0">
<a-animation attribute="rotation"
dur="1000"
begin="animation__fuse-complete"
from="0 100 0"
to="30 100 0"></a-animation>
<a-entity id="camera" look-controls camera="fov: 80; userHeight: 0" wasd-controls="enabled: false;">
<a-entity id="cursor" cursor="fuse: true; fuseTimeout: 100"
position="0 0 -1"
geometry="primitive: ring; radiusInner: 0.013; radiusOuter: 0.02"
material="color: #000; shader: flat"
animation__fuse="startEvents: fusing;
property: scale;
dur: 1000;
to: 0.4 0.4 0.4"
animation__fuseed="startEvents: animation__fuse-complete;
property: scale;
dur: 1;
to: 1 1 1">
</a-entity>
</a-entity>
</a-entity>
</a-scene>
如何正确设置相机旋转的动画?
我在 Windows 10 上使用 Chrome 59、A-Frame 0.6.1 和 aframe-animation-component
提前谢谢你,祝你有美好的一天!
最佳答案
我遇到了类似的问题,即在对相机旋转执行 setAttribute 后无法到达底部旋转位置。这是我认为正在发生的事情:
问题的出现是因为 X 轴上的旋转通过代码发生变化,从 0 度移动到 30 度,而没有相应的头部运动。结果,-90 度的下限减少了 30 度。
我认为 A 型框架的设计有一个强烈的意图,即通过头部位置产生的视角保持一致。如果你直视前方,角度突然高了30度,但你的头还没有动,一切都会歪斜。您必须向下看 30 度才能看到“笔直向前”等。
当通过桌面显示器而不是遮阳板查看 A-Frame 时,很容易尝试对这些不连续性进行编码。我认为“解决方案”必须是设计某种方式让相机在运行动画时返回到其起始位置,这样它就不会失去与玩家头部的对应关系。
关于aframe - A-Frame 0.6.1 - 相机旋转动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45194712/
我正在使用 aframe 0.8.2 加载此 Collada (DAE) 模型,并使用 aframe-ar 将其显示在 Hiro 标记上:
从 Aframe 中的 Assets 管理器加载对象时,模型显得太大,所以我想重新缩放它。 在 Aframe 网站上,它指出 如果您没有看到您的模型,请尝试将其缩小。与 A-Frame 的规模相比,O
我有一个带有 obj 和 mtl 文件的 3d 对象,该文件在 Aframe 中显示。我想在它上面应用动画,逐渐改变它的 Alpha 值以获得淡出效果。 我浏览了 AFrame 文档。但找不到与 3d
如何将圆角边缘/边界半径添加到 a 平面? 我必须做一个带圆角的正方形 最佳答案 带 a-plane 的圆角不可能。您可以使用 slice9 component 关于aframe - 如何向平面 (A
我在 AFRAME 中遇到了一个大问题。在我当前的项目中,用户可以通过按下按钮来更改带有纹理的平面的比例。当然,然后我需要更改平铺(或重复,它在 AFRAME 中的调用方式)——但无论我如何尝试,我都
我不希望玩家穿墙。我尝试了 aframe extras,但它在当前的 aframe 版本中不起作用。在 Aframe 1.3.0 中还有其他方法或解决方案吗? 最佳答案 您可以使用 AdaRoseCa
当我尝试在我的 AFRAME 项目界面中使用一些西类牙语单词时,所有带重音的字符都消失了: 只显示“Men”而不是“Menú”。 在我尝试添加的 html 页面中: 没有效果。 ¿如何正确显示那种
我正在使用 aframe-ar 并且需要将视频流显示在与嵌入场景相同的 div 中。 我正在尝试使用默认场景: 渲染的框成功嵌入到周围的 div 中,但我的网络摄像头的视频流是全屏的
我正在尝试让 Aframe 和 vuejs 相互配合良好,但控制台返回警告消息。我猜这是由于 aframe 在 vue 有机会更改它们之前检查了属性值。 警告信息 core:schema:warn U
我正在使用 a-frame js 创建平面游览。我想自动移动相机。目前我正在使用鼠标这样做。有人可以帮助我吗? 最佳答案 要在 A-Frame 中进行补间,您可能会使用 a-animation 系统:
这里是新手,如果我没有使用正确的语言或指的是正确的东西,那么先发制人的道歉。 我正在使用下面的代码加载 360 度图像作为我的场景。 .... 一切都很好。但是,当我测试时
我有一个实体,我想像这样设置它: 所以我可以在 #ui 上发出 mobileMenuOpen 事件,让实体及其所有平面淡入淡出并向上移动。但是,#ui 上的 opac
我有一个几何体设置为平面图元的实体。我如何知道我使用 raycaster/cursor 组件单击(在实体上)的点的坐标? 最好是知道系统中的坐标,其中在交点处定义了几何体的顶点。 最佳答案 检查交叉点
我想知道是否有办法获得通过 3dio.js 插入的模型的边界框,或者以其他方式计算它们的中心点?我希望将它们集中在原点上。 下图显示了相对于红色框指示的场景原点的两个模型。 最佳答案 您可以像这样访问
首先,我很抱歉我的英语不好,我是法国人。 我想知道如何添加纹理(图片是透明的 gif),并“隐藏”框以仅看到纹理。 致以诚挚的问候 最佳答案 对盒子进行纹理处理,并使透明部分透明: " 此外,尝试使用
当相机靠近球体时,我尝试显示一些文本。这个想法是,当用户看到球体移得更近时,就会显示文本,比如说“你好”。但现在我只知道如何使用实体添加固定位置的文本,我不知道如何检测相机和球体之间的距离,并在用户看
我最近使用 aframe 和 glitch 创建了一个网站,当网站出现故障时一切正常,但是一旦我上传到我的主机,每次都会出现一个弹出窗口,要求设备传感器许可“通过 HTTPS 访问此站点以进入 VR
我使用以下代码来获得视觉反馈: 问题在于,此代码应用于光标与场景中每个基本实体“碰撞”的地方。我希望它仅适用于特定元素。 (或者,禁用特定元素上的动画)。我该怎么
使用 Aframe 如何手动更改相机旋转,以便它在移动设备上工作并仍然使用外观控制? 我已经尝试通过 html 属性,如下所示: document .querySelector('[camera]
首先,我很抱歉我的英语不好,我是法国人。 我想知道如何添加纹理(图片是透明的 gif),并“隐藏”框以仅看到纹理。 致以诚挚的问候 最佳答案 对盒子进行纹理处理,并使透明部分透明: " 此外,尝试使用
我是一名优秀的程序员,十分优秀!