Skip to content

Commit

Permalink
correct alpha for renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiCheng-Lu committed Aug 8, 2023
1 parent 0b4bbe9 commit 8fdb1b1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function createScene() {
}
function createCamera() {
camera = new THREE.PerspectiveCamera(35, container.clientWidth / container.clientHeight, 1, 3000);
camera.position.set( 50, 100, 100);
camera.position.set(50, 100, 100);
// camera.position.set(0, 0, 300);
}
function createControls() {
Expand Down Expand Up @@ -68,14 +68,14 @@ function loadModel() {
//
const onError = (errorMessage) => { console.log(errorMessage); };

const parrotPosition = new THREE.Vector3(0, 0, 0);
loader.load('computer.glb', gltfResult => onLoad(gltfResult, parrotPosition), onProgress, onError);
const position = new THREE.Vector3(0, 0, 0);
loader.load('computer.glb', gltfResult => onLoad(gltfResult, position), onProgress, onError);
}

// _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

function createRenderer() {
renderer = new THREE.WebGLRenderer({ antialias: true, container });
renderer = new THREE.WebGLRenderer({ antialias: true, container, alpha: true });
renderer.setSize(container.clientWidth, container.clientHeight);
renderer.setPixelRatio(window.devicePixelRatio);
container.appendChild(renderer.domElement);
Expand Down

0 comments on commit 8fdb1b1

Please sign in to comment.