这很奇怪..three.js所停止工作,当我移动我的three.js所-指HTML文件
我在目录 '砖' 下载three.js所:
这使得一个子目录:
brick/three.js/
当我去
brick/three.js/examples
,并在Firefox中打开文件
brick/three.js/examples/webgl_geometry_cube.html
一个漂亮的旋转立方体显示出来。然后,当我将其复制(即brick/three.js/examples/webgl_geometry_cube.html)到目录'brick'并相应地更改brick/webgl_geometry_cube.html中的three.min.js引用时,brick/webgl_geometry_cube。 HTML不起作用 - 当我在Firefox中打开它时,没有立方体出现。
让我更具体地了解webgl_geometry_cube.html中的three.min.js参考。 砖/ three.js所/例子/ webgl_geometry_cube.html 的顶部看起来是这样的:
<!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;
,当我把它复制到
brick/webgl_geometry_cube.html
我改线
<script src="../build/three.min.js"></script>
到:
<script src="three.js/build/three.min.js"></script>
我确认这个新的参考实际工作,通过在Firefox打开
brick/webgl_geometry_cube.html
,选择“查看源文件”,并在源跟随参考three.min.js。如果我显示three.min.js(我是)的源代码,我很高兴。
但是,为什么在Firefox中打开移动的文件时没有多维数据集旋转?我很困惑。 webgl_geometry_cube.html中似乎没有任何其他路径依赖引用。 webgl_geometry_cube.html的完整的源代码可以在这里看到:
webgl_geometry_cube.html on Github
而且,我怎么去有关调试呢?我可以对代码进行一些步骤,看看两个文件在执行过程中的差异吗?
您是否调整过JavaScript中的'textures/crate.gif'? – 2012-08-19 11:36:31
解决了它:) 非常感谢.. – loldrup 2012-08-19 13:25:07