- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在增强现实项目中使用 Hammer,并使用 Hammer.js 成功移动、旋转和放置 3D 模型 (JSON)。
我正在尝试使用捏合事件来放大和缩小对象,但我在模型的行为方面遇到了很大的挑战。
在控制台中,根据手势,对象的比例似乎是正确的,但在应用程序中,需要几个手势才能让模型 Action ,然后它很快就会颠倒过来。
我无法缩小模型,而且模型似乎对我的捏合手势没有反应。
scaleSpeed: { default: 1 }
onPinchIn: function (event) {
this.scene.emit('objectScaling')
const scaleDelta = this.initialHammerScale + (event.scale * this.data.scaleSpeed)
this.modelScaleRig3D.scale.set(
(this.modelScaleRigAtScaleStart.x - scaleDelta),
(this.modelScaleRigAtScaleStart.y - scaleDelta),
(this.modelScaleRigAtScaleStart.z - scaleDelta)
)
}
onPinchOut: function (event) {
const scaleDelta = this.initialHammerScale + (event.scale * this.data.scaleSpeed)
this.modelScaleRig3D.scale.set(
(this.modelScaleRigAtScaleStart.x + scaleDelta),
(this.modelScaleRigAtScaleStart.y + scaleDelta),
(this.modelScaleRigAtScaleStart.z + scaleDelta)
)
}
onPinchStart: function (event) {
this.modelScaleAtScaleStart = this.modelRig.getAttribute('scale')
this.initialHammerScale = event.scale
},
有人在使用 3d 模型的锤捏事件方面取得了成功并提供了一些建议吗?
最佳答案
来自 Getting Started documentation
By default it adds a set of tap, doubletap, press, horizontal pan and swipe, and the multi-touch pinch and rotate recognizers. The pinch and rotate recognizers are disabled by default because they would make the element blocking, but you can enable them by calling:
hammertime.get('pinch').set({ enable: true });
hammertime.get('rotate').set({ enable: true });
关于javascript - 有人在 3D 模型上成功使用 Hammer.js Pinch Events 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49674986/
我正在使用 JQM 编写一个网络文档阅读器。我不希望我的用户在阅读时不断从右向左滚动,所以我的视口(viewport)是: 不过,我知道由于不同的视觉技能,用户对字体大小的偏好可能会发生变化....
所以,我有用于 TicTacToe 游戏的 ScrollView、HorizantalScrollView 和 BoardView。 当用户缩放时,虽然我通过 ScalegestureDetector
我正在使用 osmdroid (3.0.8) 开发应用程序。当我使用两根手指放大和缩小时,缩放从 map 的中心开始,而不是从两根手指的中间开始(使用 MapView.setMultiTouchCon
谷歌地图中的缩放功能是否可行,我进行了多次搜索但没有得到任何解决方案,请发表您的看法。 或者需要编写api来实现这些功能。 最佳答案 您是否使用 ScaleGestureDetector 来实现捏合和
我想知道是否有任何方法可以检测是否发生了缩放事件。我可以通过为 iOS 使用此事件绑定(bind)来实现它 $(document).bind('gesturechange',function(even
我正在开发 iOS 应用。 我添加了一个 UIPinchGestureRecognizer 来监听双指张开 Action 。 [[self view]addGestureRecognizer:[[UI
您好,我正在使用核心图来绘制报告。我想禁用图表上的收缩,我在图表上放置了一个 slider ,所以我无法禁用用户交互,因为 slider 不起作用。谁能告诉我如何禁用收缩图托管 View ? 最佳答案
我有一个自定义的照片/摄像机(想想 Snapchat),带有捏合识别器可以放大/缩小。根据我在网上找到的一些代码,这是正确的做法: 稍微放大效果正常 捕捉图像捕捉缩放后的图像 以下是我需要帮助的问题:
我想做什么 我的目标是转换列表,以便在单击某个元素时,它会平滑地上升到列表顶部,成为标题(参见示例)。实际上,它下方会出现一个菜单 UI。我可以将所有元素的高度过渡到除了单击的元素之外,以将其平滑地动
我正在 Macbook Pro 上使用 Qt (v. 5.5) 手势来查看哪些工作可靠。 TapGesture = 1, TapAndHoldGesture = 2,
嘿伙计们,我试图让一个 View 出现在父 View 中的长按上,并使其可拖动和可收缩,但就像现在一样,我只能使它成为可拖动的,但收缩不起作用。这是我的代码 class MainVC: UIViewC
我有一个带有折线图的元素,我希望能够处理捏缩放,以便用户可以放大或缩小图表的特定部分。这在除 IE11 之外的所有浏览器中都非常有效,在 IE11 中,它不是缩放元素,而是缩放整个页面。 是否有一种明
我正在尝试了解如何使用 Sencha Touch 的“捏合”触摸效果。您是否知道任何有助于第一步的示例? 文档似乎对此只字未提。 具体来说,我正在寻找作为初学者的常见任务: 我想对 JPEG 格式的图
我已经在我的应用程序的 UIImageView 上实现了 UIPinchGestureRecognizer,但是无论我在图像上的哪个位置捏合,它似乎都会放大到同一个位置。有谁知道我如何让它放大到用户实
Cocos2d:你好。很长一段时间试图通过缩放捏来做,但并非不可能。能否请您告诉如何实现缩放。 最佳答案 这是我在我的一款游戏中用于缩放的代码。 首先将此@property 添加到您想要缩放的场景(或
我有一个像这样的水平滚动元素: element1 element2 . . elementN https://jsfiddle.net/3um9n6zk/ 在触摸设备
我想使用捏合手势来更改图像的大小。通过下面所示的代码,我实现了这一点,但是之后每次我捏图片时,图像都会弹回到原始大小。 @IBAction func pinchGestureActivated(_ s
我使用 Google 的 MapView,但遇到了更大的问题。特别是多点触控缩放。我正在使用 Android 2.2 平板电脑。要使这项工作正常进行,首先需要在 AndroidManifest 中指定
我有两个问题: 我发现这段代码在 webImageView 中使用捏合,但是当我通过 WebView 更改 webImageView 时。我在代码中发现错误。我如何在 webview 中使用 pinc
我正在尝试让 Pinch Zoom 在 webview_flutter 插件/插件中工作。这是一个简单的测试应用程序,我指的是本教程作为指南 https://blog.geekyants.com/we
我是一名优秀的程序员,十分优秀!