diff --git a/entry/src/main/ets/graphics3d/SceneAnimation.ets b/entry/src/main/ets/graphics3d/SceneAnimation.ets index 919907686a315dbaa23ca9e32944c5671120fd85..31143409b45c07bcd697186f51c1081e82f693a7 100644 --- a/entry/src/main/ets/graphics3d/SceneAnimation.ets +++ b/entry/src/main/ets/graphics3d/SceneAnimation.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { Animation, Scene, Camera, EnvironmentBackgroundType, SceneResourceFactory } from '@kit.ArkGraphics3D'; +import { Animation, Scene, Camera, EnvironmentBackgroundType, SceneResourceFactory, Color } from '@kit.ArkGraphics3D'; import { Animator, router, AnimatorResult } from '@kit.ArkUI'; import Logger from '../utils/Logger'; import { Constants } from '../constants/Constants'; @@ -61,6 +61,7 @@ struct SceneAnimation { .then(async (result: Scene) => { this.scene = result; let rf: SceneResourceFactory = this.scene.getResourceFactory(); + this.scene.environment.backgroundType = EnvironmentBackgroundType.BACKGROUND_NONE; // Get animation resources this.anim = this.scene.animations[0]; @@ -68,12 +69,12 @@ struct SceneAnimation { this.anim.enabled = true; // Register callback function this.anim.onStarted(() => { - console.info('onStarted'); + Logger.info('onStarted'); this.animationCallbackInvoked = 'animation on start'; }); this.anim.onFinished(() => { - console.info('onFinished'); + Logger.info('onFinished'); this.animationCallbackInvoked = 'animation on finish'; }); @@ -87,6 +88,7 @@ struct SceneAnimation { // set the camera. this.cam.enabled = true; this.cam.position.z = 5; + this.cam.clearColor = {r: 1, g: 1, b: 1, a: 1} as Color; this.sceneOpt = { scene: this.scene, modelType: ModelType.SURFACE } as SceneOptions; }) diff --git a/screenshots/scene_animation.jpg b/screenshots/scene_animation.jpg index be61e4fae4b75b3f4feee3d49e32813f8a158a2a..c9de7886560a26437b9e84cadde29e9c9db1676e 100644 Binary files a/screenshots/scene_animation.jpg and b/screenshots/scene_animation.jpg differ