wasabia / three_dart

three.js rewrite by Dart, Dart 3D library. an easy to use, lightweight, cross-platform, general purpose 3D library.
MIT License
444 stars 77 forks source link

Transparent scene #131

Open Cyril212 opened 1 year ago

Cyril212 commented 1 year ago

Hello, first of all I want to thank you for such a fantastic library, you did a really great job!

I have one question, is it possible to make a scene transparent in order to use background of flutter view?

MapleNoise commented 1 year ago

You can try (MyApp.engine!.renderer is THREE.WebGLRenderer) :

MyApp.engine!.renderer = THREE.WebGLRenderer(_options);
MyApp.engine!.renderer!.alpha = true;
MyApp.engine!.renderer!.setClearColor(THREE.Color(0x000000), 0);
MyApp.engine!.renderer!.autoClearDepth = true;

And on your scene :

MyApp.engine!.scene = THREE.Scene();
MyApp.engine!.scene!.background = null;

Result : (In my case my background is a map) Screenshot_20230530_145457_Gallery