Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Can';在OpenGl上使用AssImp运行场景_C++_Opengl_Crash_Nvidia_Assimp - Fatal编程技术网

C++ Can';在OpenGl上使用AssImp运行场景

C++ Can';在OpenGl上使用AssImp运行场景,c++,opengl,crash,nvidia,assimp,C++,Opengl,Crash,Nvidia,Assimp,我正在使用AssImp解析一个简单的立方体(作为一个测试示例)以在OpenGl上使用。但是,当OpenGl启动时,我看到一个场景,其中包含立方体,然后Nvidia驱动程序出现以下错误: OpenGl关闭了,这一直发生在我开始使用ASIMP之后 我的英伟达是GeForce 9300米GS。 绘制多维数据集的代码非常简单: #include "Object.h" Object::Object(string filename){ scene = importer.ReadFile

我正在使用AssImp解析一个简单的立方体(作为一个测试示例)以在OpenGl上使用。但是,当OpenGl启动时,我看到一个场景,其中包含立方体,然后Nvidia驱动程序出现以下错误:

OpenGl关闭了,这一直发生在我开始使用ASIMP之后

我的英伟达是GeForce 9300米GS。 绘制多维数据集的代码非常简单:

    #include "Object.h"

Object::Object(string filename){

    scene = importer.ReadFile(filename,aiProcess_CalcTangentSpace|aiProcess_Triangulate|aiProcess_JoinIdenticalVertices|aiProcess_SortByPType);

    if(!scene){
        cout << importer.GetErrorString();
    }

}

void Object::draw(){

    if(!scene)
        return;

    if(!scene->mNumMeshes){
        cout << "NO PRIMITIVES" << endl;
        return;
    }


    for(int i = 0; i < scene->mNumMeshes ; i++){
        for (int j = 0; j < scene->mMeshes[i]->mNumFaces ; j++)
        {
            glBegin(GL_TRIANGLES);

            glVertex3f(scene->mMeshes[i]->mVertices[scene->mMeshes[i]->mFaces[j].mIndices[0]].x,
                scene->mMeshes[i]->mVertices[scene->mMeshes[i]->mFaces[j].mIndices[0]].y,
                scene->mMeshes[i]->mVertices[scene->mMeshes[i]->mFaces[j].mIndices[0]].z);
            glVertex3f(scene->mMeshes[i]->mVertices[scene->mMeshes[i]->mFaces[j].mIndices[1]].x,
                scene->mMeshes[i]->mVertices[scene->mMeshes[i]->mFaces[j].mIndices[1]].y,
                scene->mMeshes[i]->mVertices[scene->mMeshes[i]->mFaces[j].mIndices[1]].z);
            glVertex3f(scene->mMeshes[i]->mVertices[scene->mMeshes[i]->mFaces[j].mIndices[2]].x,
                scene->mMeshes[i]->mVertices[scene->mMeshes[i]->mFaces[j].mIndices[2]].y,
                scene->mMeshes[i]->mVertices[scene->mMeshes[i]->mFaces[j].mIndices[2]].z);

            glEnd;
        }
    }
}
#包括“Object.h”
对象::对象(字符串文件名){
scene=importer.ReadFile(文件名,aiProcess_CalcTangentSpace | aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType);
如果(!场景){
cout mNumMeshes){
coutmmeshes[i]>mNumFaces;j++)
{
glBegin(GL_三角形);
glVertex3f(场景->mMeshes[i]->mVertices[场景->mMeshes[i]->MFACE[j].mIndices[0]].x,
场景->mmesh[i]->mverties[scene->mmesh[i]->mFaces[j].mIndices[0].y,
scene->mmesh[i]->mverties[scene->mmesh[i]->mFaces[j].mIndices[0]].z);
glVertex3f(场景->mMeshes[i]->mVertices[场景->mMeshes[i]->MFACE[j].mIndices[1].x,
场景->Mmesh[i]->mVertices[scene->Mmesh[i]->mFaces[j].mIndices[1].y,
scene->mMeshes[i]->mVertices[scene->mMeshes[i]->mFaces[j].mIndices[1].z);
glVertex3f(场景->mMeshes[i]->mVertices[场景->mMeshes[i]->mFaces[j].mIndices[2]].x,
场景->mmesh[i]->mverties[scene->mmesh[i]->mFaces[j].mIndices[2].y,
scene->mMeshes[i]->mVertices[scene->mMeshes[i]->mFaces[j].mIndices[2].z);
格伦德;
}
}
}
有没有人用ASSIMP?< P>在英伟达的驾驶员上发生过这次撞车事故?

我不知道问题是什么。我在这个计算机中使用OpenGL很多次,用更复杂的形状来构建整个场景,但我从来没有得到这个。

在双循环中,你可能想要写<代码> GLDENE();< /C> >代替<代码> GLTEND;< /C>(这是有效的C++,但是编译器发出警告)

在双for循环中,你可能想写<代码> GLDENE(),而不是<代码> GLTEND;< /COD>(它是有效的C++,但是编译器发出警告)

在双for循环中,你可能想要写<代码> GLDENE();< /C> >而不是<代码> GLTEND;< /C>(有效的C++,但编译器发出警告)

在双for循环中,您可能想要编写<代码> GLDENE();< /COD>而不是<代码> GLTEND;< /C>(这是有效的C++,但编译器发出警告)

您使用过调试器吗?它在哪一行崩溃?我使用过,我使用的是Visual Studio,它没有说在哪一行崩溃,simple关闭显示。您使用过调试器吗?它在哪一行崩溃?我使用过,我使用的是Visual Studio,它没有说在哪一行崩溃,simple关闭显示。您使用过调试器吗?打开哪一行会崩溃?我有,我在使用Visual Studio,它没有说哪一行会崩溃,simple会关闭显示。你用过调试器吗?哪一行会崩溃?我有,我在使用Visual Studio,它没有说哪一行会崩溃,simple会关闭显示。谢谢!因为它没有发出错误,我最终没有意识到首先它是错误的。谢谢!因为它没有发出错误,我最终没有意识到它是错误的。谢谢!因为它没有发出错误,我最终没有意识到它是错误的。谢谢!因为它没有发出错误,我最终没有意识到它是错误的。