|
|
@ -32,6 +32,24 @@ document.ondragover = e => e.preventDefault();
|
|
|
|
|
|
|
|
|
|
|
|
window.onload = function ()
|
|
|
|
window.onload = function ()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
function isWebGLAvailable()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var canvas = document.createElement('canvas');
|
|
|
|
|
|
|
|
return !!(globalThis.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl')));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!isWebGLAvailable())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
document.body.textContent = "您的浏览器不支持WebGL!";
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Object3D.DefaultMatrixAutoUpdate = false;
|
|
|
|
Object3D.DefaultMatrixAutoUpdate = false;
|
|
|
|
Vector2.prototype.asVector3 = function ()
|
|
|
|
Vector2.prototype.asVector3 = function ()
|
|
|
|
{
|
|
|
|
{
|
|
|
|