I am currently exploring three.js and have encountered an issue with transparency not working as expected. Despite trying various settings, I cannot seem to achieve a transparent background - it always defaults to black or interprets the values as an RGB value. I've experimented with different configurations based on recommendations from other users:
scene = new THREE.Scene();
scene.background = new THREE.Color(0x000000, 0); (This line seems to be treated as an RGB value?)
scene.background = null;
renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });
renderer.setClearColor(0x000000, 0);
The FBX file is loaded within an iframe, and I have verified the transparency settings on the iframe. Can anyone provide some insight into this issue?
When the transparent call is made, the initial code looks like this...
import * as THREE from '../build/three.module.js';
import { OrbitControls } from './jsm/controls/OrbitControls.js';
import { FBXLoader } from './jsm/loaders/FBXLoader.js';
var container, controls;
var camera, scene, renderer, light;
var clock = new THREE.Clock();
var mixer;
init();
animate();
function init() {
container = document.createElement('div');
document.body.appendChild(container);
camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 1000);
camera.position.set(500, 10, 500);
scene = new THREE.Scene();
scene.background = new THREE.Color(0x000000, 0);
scene.background = null;