Original Post
i already have a Geomipmapping terrain rendered via a triangle fan, i only based it in Jim Adams' Terrain book i have a question for Geomipmapping; ) How can i determine the LOD for its patch effectively, since in adams book setting the LOD is hardcoded after computing the distance from the camera position to the center of the patch heres an exerpt of Jim's code( see how the Distance is compared and also the setting for the LOD of the patch) What are the other way of doing this? thanks
m_pPatches[index].fDistance = sqrtf( ((m_pPatches[index].centerx - campos.m_vector.x) * (m_pPatches[index].centerx - campos.m_vector.x)) +
((m_pPatches[index].centery - campos.m_vector.y) * (m_pPatches[index].centery - campos.m_vector.y)) +
((m_pPatches[index].centerz - campos.m_vector.z) * (m_pPatches[index].centerz - campos.m_vector.z)));
//a bit of a hack
if( m_pPatches[index].fDistance < 1000 )
m_pPatches[index].iLOD= 0;
else if( m_pPatches[index].fDistance< 1500 )
m_pPatches[index].iLOD= 1;
else if( m_pPatches[index].fDistance< 2000 )
m_pPatches[index].iLOD= 2;
else if( m_pPatches[index].fDistance>=2000)
m_pPatches[index].iLOD= 3;