iPhone - JavaScript 事件...用于 Three.js
我正在研究这个项目...它应该可以在浏览器和 iPhone 上运行。
所以我现在正在处理事件问题,我可以在 iPhone 上使用哪些 JavaScript 事件?
I am working on this project... that is suppose to work in a browser and on iPhone as well.
So I am dealing with the events issue right now, which JavaScript events can I use for iPhone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于您需要什么功能,但请在您的手机上尝试此。
它应该呈现一些类似于以下的立方体结构:
(来源:lifesine.eu)
它应该可以触摸和拖动。这是基于 Three.js 附带的旧立方体拖动示例,这里是使用的事件:
这里是侦听器:
请注意,使用了一些变量,这些变量可能并不明显,例如 targetRotation、targetRotationOnMouseDown 等。请随意使用该链接中的源代码,但请注意,我去年编写了该代码,因此,一些 Three.js 代码可能略有不同(可能是材料等),但事件部分应该仍然有效,如果您将其粘贴到你的代码。
华泰
It depends on what functionality you need, but try this on your phone.
It should render some a cube structure similar to these:
(source: lifesine.eu)
It should be possible to touch and drag. This is based on the old cube drag sample that comes with three.js and here are the events used:
And here are the listeners:
Note that there are a few variables used, which might not be obvious, like targetRotation, targetRotationOnMouseDown, etc. Feel free to use the source code from that link, but be aware that I coded that last year, so, some of the three.js code might be slightly different(maybe materials and such), but the events part should still work if you paste it in your code.
HTH