It's just all problems since I decided to learn Three.js. nothing seems to work the way intended even when following some tutorial. Here it can't even import for some reason. If you know why please share with me. Also if you know some source that I can learn Three.js from, that would also be great.
import * as THREE from "../node_modules/three/build/three.module.js"
import { TrackballControls } from "../node_modules/three/examples/jsm/controls/TrackballControls.js"
const scene = new THREE.Scene()
const camera = new THREE.PerspectiveCamera(75, window.innerWidth /
window.innerHeight, 0.6, 1200)
const renderer = new THREE.WebGLRenderer({antialias: true})
renderer.setClearColor("#00000")
renderer.setSize(window.innerWidth, window.innerHeight)
document.body.appendChild(renderer.domElement)
window.addEventListener('resize', () => {
renderer.setSize(window.innerWidth, window.innerHeight)
camera.aspect = window.innerWidth / window.innerHeight
camera.updateProjectionMatrix()
})
error: "Uncaught TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../"."
I ran: npm install --save three