react-3d-viewer
react-3d-viewer copied to clipboard
White background?
There is white background on your example. Why?
how to change the background?
how to change the background?
yes how to ?
You can pass a property "background" to model. For example <OBJModel {...props} background="rgba(0,0,0)" />
rgba doesn't work cause three needs another param to set alpha: true
Add support pls for transparent background
Gotta bundle the scripts outside of node modules and into my project in order to pass a param to set alpha true.
Would love to have these props:
background="rgba(0,0,0,0)" alpha={true}
And
In model.js Line 242 : this.renderer.setClearColor(new THREE.Color(background, alpha));
the alpha must be set en the WebGLRenderer instance in conjunction with the setClearColor() function:
So it should look like this
const { width, height, antialias, background, alpha } = this.props; this.renderer = new THREE.WebGLRenderer({ antialias, alpha: alpha }); this.renderer.setClearColor(background, 0);
the alpha must be set en the WebGLRenderer instance in conjunction with the setClearColor() function:
So it should look like this
const { width, height, antialias, background, alpha } = this.props; this.renderer = new THREE.WebGLRenderer({ antialias, alpha: alpha }); this.renderer.setClearColor(background, 0);
Hey, I'm racking my brains trying to get this to work I'm bundling the code outside of the node modules, looks like:
var { width, height, antialias, background, alpha } = this.props;
this.scene = new THREE.Scene();
this.camera = new THREE.PerspectiveCamera(45,width/height,.1,8888);
this.renderer = new THREE.WebGLRenderer({antialias, alpha: alpha});
this.renderer.setClearColor(background, 0);
this.renderer.setSize(width,height);
I haven't added any new code, just modified the existing- any advice would be rad.