Something strange is happening...
I recently downloaded three.js into a directory named 'brick':
git clone https://github.com/mrdoob/three.js.git
which created a subdirectory:
brick/three.js/
After navigating to
brick/three.js/examples
and opening the file
brick/three.js/examples/webgl_geometry_cube.html
in Firefox, I was able to see a fantastic rotating cube. However, when I copied the file (brick/three.js/examples/webgl_geometry_cube.html) into the 'brick' directory and updated the reference to three.min.js in the new brick/webgl_geometry_cube.html accordingly, the cube no longer appeared when I opened it in Firefox.
Let me delve deeper into the reference to three.min.js in webgl_geometry_cube.html. The initial content of brick/three.js/examples/webgl_geometry_cube.html looks like this:
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js webgl - geometry - cube</title>
<meta charset="utf-8">
<style>
body {
margin: 0px;
background-color: #000000;
overflow: hidden;
}
</style>
</head>
<body>
<script src="../build/three.min.js"></script>
<script>
var camera, scene, renderer;
var mesh;
After transferring it to
brick/webgl_geometry_cube.html
I modified the line
<script src="../build/three.min.js"></script>
to:
<script src="three.js/build/three.min.js"></script>
I double-checked that this updated reference was functional by opening
brick/webgl_geometry_cube.html
in Firefox, viewing the source, and following the reference to three.min.js. Seeing the source code of three.min.js (which I did) should have been a success.
Then why is the cube not rotating when I open the transferred file in Firefox? I am puzzled. There don't appear to be any other path-related references in webgl_geometry_cube.html. The complete source code of webgl_geometry_cube.html can be viewed here:
webgl_geometry_cube.html on Github
Furthermore, how can I debug this issue? Is there a way to step through the code to pinpoint where the files differ in execution?