360-degrees 相关问题


固定多条Fusion 360草图线/弧总长度的方法

我想知道是否有办法固定下面参考图像中显示的测量值,以便调整我的草图以满足我想要实现的特定目标长度?无法...


三个 JS - 在循环内的画布上渲染而不更新画布

我有下面的代码,它需要进行多次扫描。我知道这始终是 2880。画布应该将整个 360° 分成 2880 个扇区。下面代码中的循环将始终从 0...


为什么我的全景切换按钮不起作用?

我正在尝试制作一个按钮,以便将其绑定到全景图中的特定位置。也就是说,当用户观看 360 度全景图时,按钮不应旋转。 我正在尝试制作一个按钮,以便将其绑定到全景图中的特定位置。也就是说,当用户查看 360 度全景图时,按钮不应旋转。 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>panoramas</title> <script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script> <style> #switchButton { cursor: pointer; } </style> </head> <body> <a-scene> <a-assets> <img id="panorama1" src="1.jpg"> <img id="panorama2" src="2.jpg"> </a-assets> <a-sky id="panorama" src="#panorama1" rotation="0 -130 0"></a-sky> <a-entity id="cameraRig"> <a-camera></a-camera> </a-entity> <a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#CCC" id="switchButton"></a-plane> </a-scene> <script> const button = document.querySelector('#switchButton'); let currentPanorama = 1; button.addEventListener('mouseenter', () => { const panorama = document.querySelector('#panorama'); if (currentPanorama === 1) { panorama.setAttribute('src', '#panorama2'); currentPanorama = 2; } else { panorama.setAttribute('src', '#panorama1'); currentPanorama = 1; } }); </script> </body> </html> 我正在尝试制作一个按钮,以便将其绑定到全景图中的特定位置。也就是说,当用户查看 360 度全景图时,按钮不应旋转。 我解决你的问题 您需要做的是添加一个光标来处理 onlcick 事件,这是唯一的方法。 <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width"> <title>A-Frame HTML Shader - Dynamic</title> <script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script> <script src="https://unpkg.com/[email protected]/dist/aframe-html-shader.min.js"></script> <script> let currentPanorama = 1; AFRAME.registerComponent("click-log", { init: function () { this.myFunction = function () { const panorama = document.querySelector('#panorama'); if (currentPanorama === 1) { panorama.setAttribute('src', '#panorama2'); currentPanorama = 2; } else { panorama.setAttribute('src', '#panorama1'); currentPanorama = 1; } }; this.el.addEventListener("click", this.myFunction); }, remove: function () { this.el.removeEventListener("click", this.myFunction); } }); </script> </head> <body> <a-scene update-html> <a-camera> <a-cursor material="color: red"></a-cursor> </a-camera> <a-assets> <img id="panorama1" src="https://l13.alamy.com/360/PWNBM9/testing-new-cameralens-combination-in-my-garden-in-aarhus-denmark-PWNBM9.jpg"> <img id="panorama2" src="https://aframe.io/aframe/examples/boilerplate/panorama/puydesancy.jpg"> </a-assets> <a-sky id="panorama" src="#panorama1" rotation="0 -130 0"></a-sky> <a-entity id="cameraRig"> <a-camera></a-camera> </a-entity> <a-plane click-log position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#CCC" id="switchButton"></a-plane> </a-scene> </body> </html>


如何在jetpack compose中使用浮动资源

我的浮点值是360F。我在 res/values 中创建了一个名为 float.xml 的文件。 浮动.xml 我的浮点值是 360F。我在 float.xml 中创建了一个名为 res/values 的文件。 float.xml <?xml version="1.0" encoding="utf-8"?> <resources> <item name="loading_circle_target" format="float" type="dimen">360</item> </resources> 然后像这样使用 @Composable fun LoadingCircle() { val currentRotation by transition.animateValue( 0F, targetValue = dimensionResource(id = R.dimen.loading_circle_target).value, // .. more code in here ) // more code in here } 我在这里遇到错误 android.content.res.Resources$NotFoundException: Resource ID #0x7f070346 type #0x4 is not valid at android.content.res.Resources.getDimension(Resources.java:766) at androidx.compose.ui.res.PrimitiveResources_androidKt.dimensionResource(PrimitiveResources.android.kt:79) 更新 我的最低sdk是21 如果您的目标至少是 API 29,则可以使用: val floatValue = LocalContext.current.resources.getFloat(R.dimen.loading_circle_target) @Composable fun LoadingCircle() { val currentRotation by transition.animateValue( 0F, targetValue = floatValue, // .. more code in here ) // more code in here } 我不得不恢复到旧的 is_phone bool,因为 booleanResource() 支持较旧的 API 级别。所以有 <resources> <bool name="is_phone">false</bool> </resources> 在 values-sw600dp 文件夹中并将其设置为正常值文件夹中的 true。然后就可以像这样使用了 @Composable fun LoadingCircle() { val currentRotation by transition.animateValue( 0F, targetValue = if (booleanResource(id = R.bool.is_phone)) 360f else 180f ) // more code in here }


© www.soinside.com 2019 - 2024. All rights reserved.