首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络游戏 >

《focus on 3d terrain》书中的四叉树的renderNode函数的一些疑问,该如何处理

2012-02-04 
《focus on 3d terrain》书中的四叉树的renderNode函数的一些疑问在这本《focus on 3d terrain》书中的四叉树

《focus on 3d terrain》书中的四叉树的renderNode函数的一些疑问

在这本《focus on 3d terrain》书中的四叉树的renderNode函数有一段:
其中全局变量:

C/C++ code
char g_cQTFanCode[] = { 10, 8, 8, 12, 8, 0, 12, 14, 8, 12, 0, 14, 12, 14, 14, 0 }; char g_cQTFanStart[]= { 3,  3, 0,  3, 1, 0,  0,  3, 2,  2, 0,  2,  1,  1,  0, 0 }; //(thanks to Chris Cookson for this idea)             iStart= g_cQTFanStart[iFanCode];              iFanLength= 0;              //calculate the fan length by computing the index of the first non-zero bit in g_cQTFanCode             while( !( ( ( long )g_cQTFanCode[iFanCode] )&( 1<<iFanLength ) ) && iFanLength<8 )                 iFanLength++; //..........................




虽然代码意思我明白,但是我不明白他用这种方法来判断是否渲染子节点的依据是什么?或说
char g_cQTFanCode[] = { 10, 8, 8, 12, 8, 0, 12, 14, 8, 12, 0, 14, 12, 14, 14, 0 };
char g_cQTFanStart[]= { 3, 3, 0, 3, 1, 0, 0, 3, 2, 2, 0, 2, 1, 1, 0, 0 };
这两个数组的值是怎么得来?


[解决办法]
帮你项一下

热点排行