添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
强悍的苹果  ·  Python ...·  5 月前    · 
想表白的水煮鱼  ·  perl ...·  1 年前    · 

如何使用Android WebView显示一个简单的Three JS网页?

0 人关注

我正试图在我的安卓设备上显示一个简单的three.js网页。这是我到现在为止所尝试的。

public class MainActivity extends AppCompatActivity {
Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    context = this;
    WebView webView = findViewById(R.id.modelWebView);
    WebSettings webSettings = webView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    webSettings.setPluginState(WebSettings.PluginState.ON);
    webSettings.setAllowFileAccess(true);
    webSettings.setAllowContentAccess(true);
    webSettings.setAllowFileAccessFromFileURLs(true);
    webSettings.setAllowUniversalAccessFromFileURLs(true);
    webView.loadUrl("https://threejs.org/examples/#webgl_animation_cloth");

Logcat。

2021-08-05 22:20:46.046 19796-19878/com.mindstix.testarchitect E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
2021-08-05 22:20:46.047 19796-19878/com.mindstix.testarchitect E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
2021-08-05 22:20:46.581 19796-19796/com.mindstix.testarchitect I/chromium: [INFO:CONSOLE(54)] "Unrecognized feature: 'xr-spatial-tracking'.", source: https://threejs.org/examples/#webgl_animation_cloth (54)
2021-08-05 22:20:46.804 19796-19826/com.mindstix.testarchitect E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
2021-08-05 22:20:46.804 19796-19826/com.mindstix.testarchitect E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
2021-08-05 22:20:49.028 19796-19878/com.mindstix.testarchitect E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
2021-08-05 22:20:49.029 19796-19878/com.mindstix.testarchitect E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
2021-08-05 22:20:49.034 19796-19878/com.mindstix.testarchitect E/chromium: [ERROR:gles2_cmd_decoder_autogen.h(1648)] [.WebGL-0xc85e0800]GL ERROR :GL_INVALID_ENUM : GetIntegerv: <- error from previous GL command
2021-08-05 22:20:49.038 19796-19878/com.mindstix.testarchitect E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef