我正在努力遵循示例以将自己的模型加载到ArCore中。我发现以下代码:
ModelRenderable.builder()
// To load as an asset from the 'assets' folder ('src/main/assets/andy.sfb'):
.setsource(this,Uri.parse("andy.sfb"))
// Instead,load as a resource from the 'res/raw' folder ('src/main/res/raw/andy.sfb'):
//.setsource(this,R.raw.andy)
.build()
.thenaccept(renderable -> andyRenderable = renderable)
.exceptionally(
throwable -> {
Log.e(TAG,"Unable to load Renderable.",throwable);
return null;
});
但是我在任何地方都找不到ModelRenderable类以及如何导入它。同样,我正在从这样的加载模型构建应用的示例应用:
virtualObject.createonGlThread(/*context=*/ this,"models/andy.obj","models/andy.png");
virtualObject.setMaterialProperties(0.0f,2.0f,0.5f,6.0f);
但是我的模型没有png文件,只有obj和mtl。自动场景还创建了一个sfa和sfb文件。 哪一种是正确的方法?