I have been closely following the steps outlined in this tutorial: https://www.youtube.com/watch?v=6oFvqLfRnsU to create basic shapes using three.js. I noticed that at the 18:20 mark, the instructor successfully displayed a sphere on the screen.
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(75, window.innerWidth/window.innerHieght, 0.1, 1000);
camera.position.z = 5;
var renderer = new THREE.WebGLRenderer({antialias: true});
renderer.setClearColor("#e5e5e5");
renderer.setSize(window.innerWidth, window.innerHeight);
window.addEventListener('resize', () => {
renderer.setSize(window.innerWidth, window.innerHeight);
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
})
document.body.appendChild(renderer.domElement);
var geometry = new THREE.SphereGeometry(1,10,10);
var material = new THREE.MeshLambertMaterial({color: 0xFFCC00});
var mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);
renderer.render(scene, camera);
Although my scene appears to be correctly set up with the light gray background, I am encountering an issue where the black sphere is not showing up as expected.