本文介绍了3D照明(OpenGl)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经问过这个问题,但没有得到答案.顺便说一句,我发现了一些新东西.我想显示一个由实体作品导出的wrl文件中的3D模型.该文件包含三角形的顶点,我正在用glBegin(GL_TRIANGLES)绘制它们,但是它看起来并不好,并且没有似乎相当3D!我尝试了gluSphere以相同的照明设置在该场景中绘制一个球体,它看起来非常好,而且是3D的!!!
Glu有什么事吗?
我应该使用Glu绘制三角形吗?

I already asked this question but I didn't get my answer. Btw I found some thing new.I want to show a 3D model from a wrl file exported by solid works.The file contains triangle's vertices and I am drawing them with glBegin(GL_TRIANGLES), But it doesn't looks nice and doesn't seems quite 3D! I tried gluSphere to draw an sphere in that scene with same lighting setting and it seems very nice and 3D!!!!
Is there some thing about Glu ?
Should I use Glu for draw triangles?

推荐答案

要获得良好的阴影,还应提供三角形的法线.

To get a good shading you should also supply normals for the triangles.

这篇关于3D照明(OpenGl)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 22:40