Hey All,
I need some tips on how to convert float to integer.
The other part of the code in my project is a water landscape and when I add the code below and compile it supposed to show sort of a zigzag image laying on top of the water (for example a rough bush).
sample of the code:
float height = 0.0f;
for(int i = 1; i < m_Landscape.getWidth(); ++i)
{
glBegin(GL_TRIANGLE_STRIP);
for(int j = 0; j < m_Landscape.getDepth(); ++j)
{
height = m_Landscape.getHeight(i - 1, j);
glVertex3f(i - 1, height, j);
height = m_Landscape.getHeight(i, j);
glVertex3f(i, height, j);
}
glEnd();
}
The compiler keeps giving me a warning. It displays a flat/plain landscape and not the zigzag one i was hoping for.
So, I have tried to use a cast but with no luck. Maybe I’m using it incorrectly?
the compiler complains on these lines and not the whole code*
glVertex3f(i - 1, height, j);
glVertex3f(i, height, j);
any tips please?
Thanks