【发布时间】:2020-05-29 21:01:08
【问题描述】:
我正在开展一个项目,该项目将在一个片段中包含一个 3D 模型查看器。为了做到这一点,我决定使用sceneform。在我的标签片段中尝试显示 SceneView 后,我遇到了问题。
一切都是按照示例和sceneform文档完成的,但是sceneView显示黑屏,不管我分配什么颜色。
这里是场景加载器
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
vw = inflater.inflate(R.layout.fragment_open_gl, container, false);
sceneView = vw.findViewById(R.id.scene_view);
return vw;
}
还有片段:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".OpenGL">
<com.google.ar.sceneform.SceneView
android:id="@+id/scene_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/Crimson"/>
</FrameLayout>
【问题讨论】:
标签: android 3d augmented-reality sceneform