随着计算机图形学与科学计算可视化的发展,如何应用不同的颜色来表达和区分属性不同的数据源是一个关键问题。在分析了颜色模型和OpenGL中光照计算的基础上,本文以颜色线性插值法、线性倒插法以及余弦插值法为例,给出了三维模型颜色动态渲染的步骤。在OpenGL环境下,利用VC++实现了场景中的三维颜色渲染效果,为开发相应的三维建模软件提供借鉴。
With the development of computer graphics and seientific visualization, it is key problem that how to illustrate and distinct the different data source by using different colors. On the basis of analysing the color model and lighting calculation in OpenGL, the paper depicted three algorithms for colors rendering, which were linear interpolation, reverse linear interpolation, cosine interpolation. Took above algorithms for example, the steps of colors dynamic rendering were given. Under the condition of OpenGL, the scene effect of color rendering is realized through programming with VC++. it is feasible that the methods can reslove the issue of colors rendering for developing the software of three-dimensional modeling.