0

我正在关注本教程的灯丝:https ://medium.com/@philiprideout/getting-started-with-filament-on-android-d10b16f0ec67

如何将背景颜色设置为白色?

override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        surfaceView = SurfaceView(this).apply {
            setContentView(this)
        }
        choreographer = Choreographer.getInstance()
        modelViewer = ModelViewer(surfaceView)
        surfaceView.setOnTouchListener(modelViewer)

        loadGlb("DamagedHelmet")

        modelViewer.scene.skybox = Skybox.Builder().build(modelViewer.engine)
        loadEnvironment("venetian_crossroads_2k")

    }

我试过设置背景颜色,SurfaceView但没有奏效。

目前,它看起来像这样(似乎默认为黑色):

4

1 回答 1

0

我想到了。我需要设置天空盒颜色。

例如,这会将颜色设置为红色。

modelViewer.view.blendMode = com.google.android.filament.View.BlendMode.OPAQUE
modelViewer.scene.skybox = Skybox.Builder().color(0.81f, 0f, 0f, 0f).build(modelViewer.engine)
于 2022-02-23T20:11:25.627 回答