如何使用带有phonegap的threejs?

时间:2021-12-06 06:39:32

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.

任务是非常自我描述的。我用一个简单的3D立方体进行了测试。它在浏览器中工作正常。但只是在模拟器中显示一个空白页面。

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

有些人认为threejs不适用于phonegap,但有些人说他们使用过它并且工作正常!

1 个解决方案

#1


2  

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

在Android中,您可以使用Chrome应用来显示您的网页,也可以使用phonegap / cordova并使用嵌入式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.

在Lollipop之前,默认的WebView依赖于操作系统更新,现在在Lollipop(5.x)的设备上,有一个更新的'Android System WebView'。

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

在此页面中:https://developer.chrome.com/multidevice/webview/overview您可以看到在WebView v36之前未添加WebGL支持。

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.

在模拟器上,我不相信WebView支持WebGL,但您应该能够在具有Lollipop及更高版本的设备上使用它。

EDIT 2015-12-02

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

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

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

Crosswalk项目需要考虑以允许更多设备运行您的WebGL代码。

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

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

#1


2  

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

在Android中,您可以使用Chrome应用来显示您的网页,也可以使用phonegap / cordova并使用嵌入式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.

在Lollipop之前,默认的WebView依赖于操作系统更新,现在在Lollipop(5.x)的设备上,有一个更新的'Android System WebView'。

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

在此页面中:https://developer.chrome.com/multidevice/webview/overview您可以看到在WebView v36之前未添加WebGL支持。

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.

在模拟器上,我不相信WebView支持WebGL,但您应该能够在具有Lollipop及更高版本的设备上使用它。

EDIT 2015-12-02

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

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

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

Crosswalk项目需要考虑以允许更多设备运行您的WebGL代码。

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

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