float colorR, colorG, colorB;
if (!bFirstTime)
{
int iHeightBlance;
for (int i = 0; i < m_nRow - 1; i++)
{
glBegin(GL_TRIANGLE_STRIP);
for (int j = 0; j < m_nCol - 1; ++j)
{
iHeightBlance = (m_pEle[j] - minHeight[j]);
if (iHeightBlance > 0)
{
x1 = 2.0f*(float)(j)/m_nCol-1.0f;
z1 = 2.0f*(float)(i)/m_nRow-1.0f;
y1 = (float)(m_pEle[i*m_nCol+j])/(float)MaxHeight - (float)iHeightBlance/MaxHeight;
//Vertex3f(x1,y1-(float)iHeightBlance/MaxHeight,z1);
glTexCoord2f(0.0f, 0.0f);
//fc = (float)imageData[(32 * j / m_nCol + m_nCol * (32 * i / m_nRow))*3]/255.0f;
//fc = (x1 + 1) / 2.0f;
colorR = j / iEach / 4.0;
colorG = 0.5;
colorB = j / iEach / 4.0;
glColor3f(colorR,colorG,colorB);
glVertex3f(x1 , y1, z1);
234
最新推荐文章于 2023-01-18 15:38:37 发布