A 3D Website made using Three.js - a cross-browser JavaScript library and application programming interface used to create and display animated 3D computer graphics in a web browser using WebGL.
- Try Running it yourself !
-
Start a WebServer
Chrome and other modern browsers have implemented security restrictions for Cross Origin Requests (CORS), which means that we cannot load anything throughfile:///
, we need to usehttp://
protocol at all times, even locally - due to Same Origin policies. Therefore, a webserver is to be mounted to run the project, otherwise the following error occurs (on Google Chrome) while loading assets from local storage :Access to
asset
at'url'
from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https. -
Run index.html
This website only uses the Three.js and Three.js - OrbitControls CDNs. So Installation of packages (npm etc.) isn't required. All that is needed to be done is to clone the repo & run index.html on a live webserver.
NOTE: Although no packages are installed, it is always preffered to do so (or using both) since CDNs can be updated frequently and may break some stuff. (unlike package instllations where you can control which version you use.)