小编Mat*_*lzl的帖子

Opengl表面渲染问题

我刚开始加载一些obj文件并用opengl渲染它.当我渲染这些网格时,我得到了这个结果(见图片).我认为它有某种深度问题,但我不能自己弄明白.这是渲染的参数:

    // Dark blue background
glClearColor(0.0f, 0.0f, 0.4f, 0.0f);

// Enable depth test
glEnable( GL_DEPTH_TEST );

// Cull triangles which normal is not towards the camera
glEnable(GL_CULL_FACE);
Run Code Online (Sandbox Code Playgroud)

我使用这个教程代码作为模板.https://code.google.com/p/opengl-tutorial-org/source/browse/#hg%2Ftutorial08_basic_shading 在此输入图像描述 在此输入图像描述

c++ opengl 3d rendering

2
推荐指数
1
解决办法
391
查看次数

解决模糊的模板

我想知道是否有可能解决这个模糊的模板函数:

//function1
template<typename returnType>
returnType call()
{
    //function with return type
}

//function2
template<typename var>
void call()
{
    //function without return type  
}

call<int>();  //call function1
call<void>(); //call function2 
Run Code Online (Sandbox Code Playgroud)

我想阻止以下解决方案:

    //function1
template<typename returnType>
returnType call()
{
    //function with return type
}

//function2
void call()
{
    //function without      
}

call<int>();  //call function1
call(); //call function2
Run Code Online (Sandbox Code Playgroud)

c++ templates ambiguous

2
推荐指数
1
解决办法
565
查看次数

标签 统计

c++ ×2

3d ×1

ambiguous ×1

opengl ×1

rendering ×1

templates ×1