# help with horizonmapping

This topic is 4523 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

well i tried to write a function to calculate horizons based on angles... this is what i have...
#define PIUNDER180 57.2957795130823208767981548141052f

float* CLIGHTING::CalculateHorizonMap(float* Mesh, float lightangle)
{

float* Temp = new float [m_size*m_size];

float angle;

for ( int z = 0; z < m_size; z++)
{
for (int x = 0; x < m_size; x++)
{
angle = 0.0f;
for (int x1 = x-1; x1 > 0; x1--)
{

float opp = Mesh[x1+(m_size*z)];

if ( Newangle > Angle)
{
angle = Newangle;
}
}

Temp[x+(m_size*z)] = angle;
}
}

return Temp;

}


but as u may guess it doesnt work... its pretty simple but i dont get where ive gone wrong.. any suggetions?

1. 1
2. 2
Rutin
17
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• ### Forum Statistics

• Total Topics
633270
• Total Posts
3011159
• ### Who's Online (See full list)

There are no registered users currently online

×