如何将threejs与phonegap一起使用? [英] How to use threejs with phonegap?

查看:41
本文介绍了如何将threejs与phonegap一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个任务非常自我描述.我已经用一个简单的 3D 立方体进行了测试.它在浏览器中运行良好.但只是在模拟器中显示一个空白页面.

The questing is very self-describing. I have tested with a simple 3D cube. it works fine in browser. but just displays a blank page in emulator.

有人说threejs不能与phonegap一起使用,但其他人说他们使用过并且工作正常!

Some says that threejs does not work with phonegap, but some others say they used and it works fine !

推荐答案

在 Android 中,您可以使用 Chrome 应用程序来显示您的网页,也可以使用 phonegap/cordova 并使用嵌入式 WebView.

In Android you can either use the Chrome app to show your webpage or use phonegap/cordova and used the embedded WebView.

在 Lollipop 之前,默认 WebView 依赖于操作系统更新,现在在 Lollipop (5.x) 及更高版本的设备上,有一个Android 系统 WebView"已更新.

Until Lollipop the default WebView depended on OS updates, now on devices from Lollipop (5.x) and up there is a 'Android System WebView' which is updated.

从此页面:https://developer.chrome.com/multidevice/webview/overview您可以看到直到 WebView v36 才添加了 WebGL 支持.

From this page: https://developer.chrome.com/multidevice/webview/overview You can see that WebGL support wasn't added until WebView v36.

在模拟器上,我认为 WebView 不支持 WebGL,但您应该可以在 Lollipop 及更高版本的设备上使用它.

On emulator I don't believe that WebGL is supported in the WebView but you should be able to use it on devices with Lollipop and higher.

编辑 2015-12-02

如果您想在低于 Lollipop (5.x) 的 Android 设备上使用 WebGL,另一种可能性是您可以包含自己的浏览器组件.

One other possibility if you want to use WebGL on Android devices lower than Lollipop (5.x) you could include your own browser component.

Crosswalk 项目值得关注,以允许更多设备运行您的 WebGL 代码.

The Crosswalk Project would be something to look at to allow for more devices to run your WebGL code.

请注意此处列出的 WebGL 限制:https://crosswalk-project.org/documentation/about/faq.html#Canvas-and-WebGL-support

Do note the WebGL limitations listed here: https://crosswalk-project.org/documentation/about/faq.html#Canvas-and-WebGL-support

这篇关于如何将threejs与phonegap一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆