ThreeJS:IE11在Render()上崩溃;

时间:2014-04-16 06:05:35

标签: javascript internet-explorer crash three.js webgl

我在使用WebGL进行编程时遇到了Internet Explorer 11的一些奇怪问题。我已经在所有浏览器中都运行正常,但突然间,当我改变4个网格的位置时...... IE决定崩溃(在调试模式下,没有指向代码中的任何特定内容)。

我用

运行IE 11

GL版 - WebGL 0.93

着色语言版本 - WebGL GLSL ES 0.93

我收到以下错误: iexplore.exe中0x03F6435B(mshtml.dll)的未处理异常:0xC0000005:访问冲突写入位置0xBF35051C。

(5 last)Call Stack:

  

mshtml.dll!CMarkupPointer :: RemoveMeFromList(void)未知     mshtml.dll!CBackgroundInfo::Property<class CBackgroundImage>(int)':: 7&#39; ::`动态atexit析构函数用于&#39; fieldDefaultValue&#39;&#39;(void)未知     mshtml.dll!CMarkupPointer :: MoveToPointer(类CMarkupPointer const *)未知     mshtml.dll!CDisplayPointer :: MoveToPointer(类CDisplayPointer *)未知     mshtml.dll!CSelectTracker :: DoSelection(类CEditEvent *,int,int *)未知

这是创建网格的代码:

function PrepareFlowArrows(l_vDiffuser) {
    var m_vExtraLoader = new THREE.JSONLoader();
    m_vExtraLoader.load('3D_Control/models/FlowArrow.js', callbackLoadFlowArrows(l_vDiffuser));
}

// Callback function for FlowArrows when loading models
function callbackLoadFlowArrows(l_vDiffuser) {
    return function (geometry) {
        var l_vRotation = 0;
        for (var i = 0; i < 4; i++) {
            if (i == 0)
                l_vRotation = -1.5707; //-1.5707;
            else if (i == 1)
                l_vRotation = 3.1414;//3.1414;
            else if (i == 2)
                l_vRotation = 1.5707;//1.5707;
            else
                l_vRotation = 0;

            var l_vMaterial = new THREE.MeshBasicMaterial();                      // SETTINGS COLORS MANUALLY (way more nicer with textures though)
            l_vMaterial.color.r = 0;
            l_vMaterial.color.g = 255;
            l_vMaterial.color.b = 0;

            var m_vTempFlowArrowMesh = new THREE.Mesh(geometry, l_vMaterial);
            m_vTempFlowArrowMesh.scale.x = m_vTempFlowArrowMesh.scale.y = m_vTempFlowArrowMesh.scale.z *= 25;
            m_vTempFlowArrowMesh.position.set(0, 0, 0);
            m_vTempFlowArrowMesh.rotation.y = l_vRotation;
            l_vDiffuser.AddFlowArrow(m_vTempFlowArrowMesh);
            m_vScene.add(m_vTempFlowArrowMesh);
        }
    }
}

这是由于某种原因在Render()时崩溃IE11的代码;被调用并且网格被设置为可见。

this.UpdateFlowArrows = function () {
    this.GetBoundingBox();
    if (m_vFlowArrows[0] != null) {
        m_vFlowArrows[0].position.x = m_vBoundingBox.min.x - 100;
        m_vFlowArrows[0].position.y = m_vBoundingBox.min.y + ((m_vBoundingBox.max.y - m_vBoundingBox.min.y) / 2);
        m_vFlowArrows[0].position.z = m_vBoundingBox.min.z + ((m_vBoundingBox.max.z - m_vBoundingBox.min.z) / 2);
        //m_vFlowArrows[0].rotation.y = -1.5707;
    }

    if (m_vFlowArrows[1] != null) {
        m_vFlowArrows[1].position.x = m_vBoundingBox.min.x + ((m_vBoundingBox.max.x - m_vBoundingBox.min.x) / 2);
        m_vFlowArrows[1].position.y = m_vBoundingBox.min.y + ((m_vBoundingBox.max.y - m_vBoundingBox.min.y) / 2);
        m_vFlowArrows[1].position.z = m_vBoundingBox.min.z - 100;
        //m_vFlowArrows[1].rotation.y = 3.1414;
    }

    if (m_vFlowArrows[2] != null) {
        m_vFlowArrows[2].position.x = m_vBoundingBox.max.x + 100;
        m_vFlowArrows[2].position.y = m_vBoundingBox.max.y - ((m_vBoundingBox.max.y - m_vBoundingBox.min.y) / 2);
        m_vFlowArrows[2].position.z = m_vBoundingBox.max.z - ((m_vBoundingBox.max.z - m_vBoundingBox.min.z) / 2);
        //m_vFlowArrows[0].rotation.y = 1.5707;
    }

    if (m_vFlowArrows[3] != null) {
        m_vFlowArrows[3].position.x = m_vBoundingBox.max.x - ((m_vBoundingBox.max.x - m_vBoundingBox.min.x) / 2);
        m_vFlowArrows[3].position.y = m_vBoundingBox.max.y - ((m_vBoundingBox.max.y - m_vBoundingBox.min.y) / 2);
        m_vFlowArrows[3].position.z = m_vBoundingBox.max.z + 100;
        //m_vFlowArrows[3].rotation.y = 1.5707;
    }
}

请注意,此代码适用于Chrome,Opera和Firefox。我可以以某种方式重写此代码,以便IE不会崩溃吗?

修改 有趣的事情......如果我添加行

 m_vTempFlowArrowMesh.visible = false;
callbackLoadFlowArrows中的

......即使它更新了箭头,它也不会崩溃。

1 个答案:

答案 0 :(得分:0)

IE团队不能(出于某些尴尬的原因)重现此错误。

即使我已经发送了大约3x800mb的崩溃转储文件以及IE客户端的信息文件,但他们无法找到问题。

所以......他们关闭了这个问题,因为它们在他们眼中已不再适用了。

GG Microsoft。

叹息