亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? quake3format.htm

?? 用opengl實現的bsp管理3D場景的算法
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
       int numOfIndices;     // The number
  of&nbsp;level indices&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int lightmapID;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // The
  texture index for the lightmap&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int lMapCorner[2];&nbsp;&nbsp;&nbsp; // The face's lightmap
  corner in the image&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int lMapSize[2];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // The size
  of the lightmap section&nbsp;<br>
  &nbsp;&nbsp;&nbsp; float lMapPos[3];&nbsp;&nbsp;&nbsp;&nbsp; // The 3D origin of lightmap.&nbsp;<br>
  &nbsp;&nbsp;&nbsp; float lMapVecs[2][3]; // The 3D space for s and t unit vectors.&nbsp;<br>
  &nbsp;&nbsp;&nbsp; float vNormal[3];&nbsp;&nbsp;&nbsp;&nbsp; // The face
  normal.&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int size[2];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  // The bezier patch dimensions.&nbsp;<br>
  };<br>
  <br>
  <br>
  <font size="3" face="Times New Roman">If the face <b>type</b> is 1 (normal
  polygons), the vertexIndex and numOfVerts can be used to index into the vertex
  array to render triangle fans.<br>
  <br>
  If the face <b>type</b> is 2 (bezier path), the vertexIndex and numOfVerts act
  as a 2D grid of control points, where the grid dimensions are described by the
  size[2] array.&nbsp; You can render the bezier patches with just the vertices
  and not fill in the curve information, but it looks horrible and
  blocky.&nbsp;&nbsp;</font></code>
  </p>
  <p class="MsoBodyText"><code><font size="3" face="Times New Roman">The point
  of the curved surfaces are to be able to create a more defined surface,
  depending on the specs of the computer that is running that application.&nbsp;
  Some computers with horrible speed and video cards would make the smallest
  amount of polygons from the curve, where as the fast computers using Geforce
  cards could use the highest amount of polygons to form a perfect curve.<br>
  <br>
  If the face <b>type</b> is 3 (mesh vertices), the vertexIndex and numOfVerts
  also work the same as if the <b>type</b> is 1<br>
  <br>
  If the face <b>type</b> is 4, the vertexIndex is the position of the
  billboard.&nbsp; The billboards are used for light effects such as flares,
  etc...</font></code>
  </p>
  <p class="MsoBodyText">
  </p>
  <table width="570">
    <tr bgColor="#2165ae">
      <td height="17" width="562"><b><font size="5">Textures</font></b></td>
    </tr>
  </table>
  <p class="MsoBodyText">The texture structure stores the name of the texture,
  along with some surface information which are associated with the brush, brush
  sides and faces.&nbsp; To calculate the number of textures in the lump you
  divide it's&nbsp; <b>length</b> by the sizeof(<b>tBSPTexture</b>).
  </p>
  <p class="MsoBodyText">
  <code>
  <br>
  struct <b> tBSPTexture</b><br>
  {<br>
  &nbsp;&nbsp;&nbsp; char strName[64];&nbsp;&nbsp; // The name of the texture
  w/o the extension&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int flags;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  // The surface flags (unknown)&nbsp;<br>&nbsp;&nbsp;&nbsp; int 
                  textureType;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // The type 
                  of texture (solid, water, slime, etc..)&nbsp;(type &amp; 1) =
                 1(solid)<br>
  };<br>
  <br>
  </code>
  </p>
  <p class="MsoBodyText">
  </p>
  <table width="570">
    <tr bgColor="#2165ae">
      <td height="17" width="562"><b><font size="5">Lightmaps</font></b></td>
    </tr>
  </table>
  <p class="MsoBodyText">Unlike the textures, the lightmaps are stored in the .bsp
  file as 128x128 RGB images.&nbsp; Many faces share the same lightmap with
  their own section of it stored in the lightmap UV coordinates.&nbsp; Once you
  read in the lightmaps, you will want to create textures from them.&nbsp; To
  calculate the number of lightmaps&nbsp; in the lump you divide the <b> length</b> of
  the lump by the sizeof(<b>tBSPLightmap</b>).
  </p>
  <p class="MsoBodyText">
  <code>
  <br>
  struct <b>tBSPLightmap</b><br>
  {<br>
  &nbsp;&nbsp;&nbsp; byte imageBits[128][128][3];&nbsp;&nbsp; // The RGB data in
  a 128x128 image<br>
  };<br>
  <br>
  </code>
  </p>
  <p class="MsoBodyText">
  </p>
  <table width="571">
    <tr bgColor="#2165ae">
      <td height="17" width="563"><b><font size="5">Nodes</font></b></td>
    </tr>
  </table>
  <p class="MsoBodyText">The node structure holds the nodes that make up the BSP
  tree.&nbsp; The BSP is not used for rendering so much in Quake3, but for
  collision detection.&nbsp; The node holds the splitter <b>plane</b> index, the
  <b>front</b> and <b>back</b> index, along with the bounding box for the
  node.&nbsp; If the <b>front</b> or <b>back</b> indices are negative, then it's
  an index into the leafs array.&nbsp; Since negative numbers can't constitute
  an array index, you need to use the ~ operator or -(index&nbsp; + 1) to find
  the correct index.&nbsp; This is because 0 is the starting index.&nbsp; To
  calculate the number of nodes in the lump you divide the <b> length</b> of the lump by
  the sizeof(<code><b>tNode</b></code>).
  </p>
  <p class="MsoBodyText">
  <code>
  <br>
  struct <b> tNode</b><br>
  {<br>
  &nbsp;&nbsp;&nbsp; int plane;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // The index into
  the planes array&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int front;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // The child index
  for the front node&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int back;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // The child
  index for the back node&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int mins[3];&nbsp;&nbsp;&nbsp; // The bounding box min
  position.&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int maxs[3];&nbsp;&nbsp;&nbsp; // The bounding box max
  position.&nbsp;<br>
  };
  </code>
  </p>
  <p class="MsoBodyText">
  </p>
  <table width="570">
    <tr bgColor="#2165ae">
      <td height="17" width="562"><b><font size="5">Leafs</font></b></td>
    </tr>
  </table>
  <p class="MsoBodyText">The leafs, like the faces, are a very important part of
  the BSP information.&nbsp; They store the&nbsp; visibility cluster, the area
  portal, the leaf bounding box, the index into the faces, the number of leaf
  faces, the index into the brushes for collision, and finally,&nbsp; the number
  of leaf brushes.&nbsp; To calculate the number of leafs in the lump you divide
  the <b> length</b> of the lump by the sizeof(<code><b>tLeaf</b></code>).
  </p>
  <p class="MsoBodyText">
  <code>
  <br>
  struct <b> tLeaf</b><br>
  {<br>
  &nbsp;&nbsp;&nbsp; int cluster;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  // The visibility cluster&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int area;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  // The area portal&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int mins[3];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  // The bounding box min position&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int maxs[3];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  // The bounding box max position&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int leafface;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  // The first index into the face array&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int numOfLeafFaces;&nbsp;&nbsp;&nbsp; // The number of
  faces for this leaf&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int leafBrush;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  // The first index for into the brushes&nbsp;<br>
  &nbsp;&nbsp;&nbsp; int numOfLeafBrushes;&nbsp; // The number of brushes for
  this leaf&nbsp;<br>
  };
  </code>
  </p>
  <p class="MsoBodyText">
  </p>
  <table width="570">
    <tr bgColor="#2165ae">
      <td height="17" width="562"><b><font size="5">Leaf Faces</font></b></td>
    </tr>
  </table>
  <p class="MsoBodyText">The leaf faces are used to index into <b>tBSPFace</b>s
  array.&nbsp; You might at first think this is strange to have the <b>tBSPLeaf</b>
  structure have an index into the <b>pLeafFace</b>s array, which in turn is
  just an index into the <b>tBSPFace</b>s array.&nbsp; This is because it's set
  up to start with a starting point (<b>leafface</b>) and a count to go from
  there for each face (<b>numOfLeafFaces</b>).&nbsp; The faces array is not
  contiguous (in a row) according to each leaf.&nbsp; That is where the leaf
  faces array comes into play.&nbsp; It's kinda like the same concept of model
  loaders where they store the vertices and then have faces that store the
  indices into the vertex array for that face.&nbsp; To calculate the number of
  leaf faces in the lump you divide the <b>length</b> of the lump by the sizeof(<b>int</b>).&nbsp;
  </p>
  <p class="MsoBodyText">
  <code>int *pLeafFaces;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  // The index into the face array</code>
  </p>
  <p class="MsoBodyText">
  </p>
  <table width="570">
    <tr bgColor="#2165ae">
      <td height="17" width="562"><b><font size="5">Planes</font></b></td>
    </tr>
  </table>
  <p class="MsoBodyText">The plane structure stores the normal to the plane and
  it's distance to the origin.&nbsp; We use this as the splitter plane for the
  BSP tree.&nbsp; When rendering or testing collision, we can test the camera
  position against the planes to see which plane we are in front of.&nbsp; To
  calculate the number of planes in the lump you divide the <b> length</b> of the lump
  by the sizeof(<code><b>tPlane</b></code>).
  <code>
  <br>
  <br>
  struct <b> tPlane</b><br>
  {<br>
  &nbsp;&nbsp;&nbsp; float vNormal[3];&nbsp;&nbsp;&nbsp;&nbsp; //  Plane normal.&nbsp;<br>
  &nbsp;&nbsp;&nbsp; float d;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  // The plane distance from origin&nbsp;<br>
  };<br>
  <br>
  </code>
  </p>
  <p class="MsoBodyText">
  </p>
  <table width="570">
    <tr bgColor="#2165ae">
      <td height="17" width="562"><b><font size="5">Visibility Data</font></b></td>
    </tr>
  </table>
  <p class="MsoBodyText">The visibility information is comprised of a bunch of
  bitsets that store a bit for every cluster.&nbsp; This is because the
  information is so massive that this way makes it faster to access and a
  smaller memory footprint.&nbsp; There is only one instance of this structure,
  but you calculate how much needs to be read in bytes by either: numOfVectors *
  vectorSize, or minute the size of 2 integers from this lumps length.&nbsp; The
  pVecs is then dynamically allocated and stores the calculate bytes.&nbsp; This
  is probably one of the most confusing parts about the .bsp file format, the
  visibilty.&nbsp; I will try and explain the important parts of it and give
  some code.
  </p>
  <p class="MsoBodyText">
  <code>
  <br>
  struct <b> tVisData</b><br>
  {<br>
  &nbsp;&nbsp;&nbsp; int numOfVectors;&nbsp;&nbsp;&nbsp;&nbsp; // This stores
  the number of bit-vectors<br>
  &nbsp;&nbsp;&nbsp; int vectorSize;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // The
  size of bit-vectors in bytes<br>
  &nbsp;&nbsp;&nbsp; byte *pVecs;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  // This holds all of the cluster bits<br>
  };
  </code>
  </p>
  <p class="MsoBodyText">
  To demonstrate what a cluster is and what we need to do with it, let's start
  with a simple example.&nbsp; When rendering, first we want to find which leaf
  we are in.&nbsp; Once again, a leaf is an end node of the BSP tree that holds
  a bunch of information about the faces, brushes and the cluster it's in.&nbsp;
  Once that leaf is founding by checking the camera position against all of the
  planes, we then want to go through all of the leafs and check if their cluster
  is visible from the current cluster we are in.&nbsp; If it is, that means that
  we need to check if that leaf's bounding box is inside of our frustum before
  we draw it.&nbsp;&nbsp;
  </p>
  <p class="MsoBodyText">
  Say we have cluster A, B and C.&nbsp; Each cluster is stored as a bit in
  bitset.&nbsp; A bitset is just a huge list of binary numbers next to each
  other.&nbsp; Each cluster has their own list of bits that store a 1 or a 0 to
  tell if the cluster in that bit is visible (1) or not visible (0).&nbsp; Since
  there is most likely more than 32 clusters in a level, you can't just use an
  integer (32-bits) to store the bits for all the clusters.&nbsp; This is why
  there are many <b>bytes</b> assigned to each cluster.&nbsp; So, here is how it

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品人人做人人爽| 国产欧美一区二区三区沐欲| 1区2区3区精品视频| 粉嫩绯色av一区二区在线观看| 久久久噜噜噜久久人人看 | 成人黄色av网站在线| 亚洲图片欧美视频| 奇米888四色在线精品| 尤物在线观看一区| 日本精品免费观看高清观看| 亚洲男同性恋视频| 欧美嫩在线观看| 精品一区二区三区视频在线观看| 欧美zozozo| 99综合影院在线| 亚洲成人综合在线| 欧美成人福利视频| 成人午夜免费视频| 亚洲一区在线视频观看| 欧美一区二区三区视频免费播放| 伦理电影国产精品| 欧美激情综合在线| 在线看国产一区| 蜜桃一区二区三区四区| 国产欧美日韩视频在线观看| 在线看国产日韩| 欧美午夜宅男影院| 欧美国产97人人爽人人喊| 91日韩精品一区| 日韩电影一区二区三区| 国产视频一区在线观看| 日本韩国精品在线| 久久精品噜噜噜成人av农村| 日本不卡中文字幕| 国产精一区二区三区| **欧美大码日韩| 欧美一级夜夜爽| 99久久免费精品高清特色大片| 亚洲不卡在线观看| 国产精品欧美精品| 欧美一区二区三区日韩视频| 国产 欧美在线| 亚洲色图丝袜美腿| 亚洲欧美综合色| 欧美亚男人的天堂| 国产激情偷乱视频一区二区三区| 国产91丝袜在线18| 欧美在线观看你懂的| 成人免费看黄yyy456| 3d动漫精品啪啪1区2区免费| 亚洲第一在线综合网站| 91丨九色丨蝌蚪富婆spa| 中文字幕一区二区三区在线不卡| 激情综合色播激情啊| 中文字幕一区二区三区在线观看| 亚洲欧美偷拍卡通变态| 欧美亚男人的天堂| 处破女av一区二区| 久久精品国产精品亚洲红杏| 依依成人综合视频| 欧美经典一区二区三区| 日韩一区二区三区视频| 欧洲日韩一区二区三区| www.亚洲在线| 国产激情一区二区三区四区| 亚洲综合激情另类小说区| 中文字幕一区二区三区乱码在线 | 在线日韩av片| 高清不卡在线观看| 久久99这里只有精品| 亚洲一线二线三线久久久| 中文字幕在线不卡| 国产嫩草影院久久久久| 国产午夜精品久久久久久免费视| 91精品国产综合久久精品app| 色域天天综合网| 成人av资源网站| 国产91色综合久久免费分享| 国产又粗又猛又爽又黄91精品| 亚洲va天堂va国产va久| 一区二区三区.www| 一区二区三区四区高清精品免费观看| 国产精品电影院| 国产精品久久久久aaaa| 国产精品素人视频| 亚洲国产精品成人综合色在线婷婷| 精品盗摄一区二区三区| 欧美变态口味重另类| 6080yy午夜一二三区久久| 555www色欧美视频| 欧美一级艳片视频免费观看| 日韩一区二区在线免费观看| 精品久久久久久久久久久久包黑料 | 丝袜美腿一区二区三区| 偷窥国产亚洲免费视频| 午夜成人免费视频| 日本欧美加勒比视频| 久久99热国产| 国产精品白丝av| 99精品视频在线播放观看| 91蝌蚪国产九色| 欧美日韩日本视频| 日韩欧美二区三区| 久久综合九色综合久久久精品综合| 日韩欧美国产系列| 国产无遮挡一区二区三区毛片日本| 国产人久久人人人人爽| 亚洲狼人国产精品| 性感美女极品91精品| 日韩电影免费在线看| 国产成人亚洲综合a∨婷婷图片| 成人av资源在线观看| 欧美日韩亚州综合| 精品国产乱码久久久久久牛牛| 国产亚洲欧美中文| 亚洲精品日韩综合观看成人91| 天天综合网 天天综合色| 国产一区二区毛片| 在线观看视频一区| 日韩精品一区二区三区蜜臀 | 免费在线观看成人| 粉嫩aⅴ一区二区三区四区| 欧美丝袜丝交足nylons| 日韩精品一区二区三区三区免费| 国产精品免费视频网站| 亚洲超碰97人人做人人爱| 国产精品99久久久久久宅男| 日本韩国欧美国产| 久久久亚洲国产美女国产盗摄 | 91啪亚洲精品| 26uuu亚洲综合色欧美| 中文字幕一区二区视频| 美国三级日本三级久久99| 成人国产精品视频| 91精品国产免费| 国产精品另类一区| 国产揄拍国内精品对白| 日精品一区二区| 国产精品18久久久久| 欧美在线视频不卡| 国产欧美日韩另类一区| 石原莉奈在线亚洲三区| 99久久er热在这里只有精品66| 91精品在线免费| 亚洲精品免费电影| 国产盗摄精品一区二区三区在线| 欧美亚洲自拍偷拍| 国产精品狼人久久影院观看方式| 久久精品国产一区二区三| 在线观看亚洲专区| 国产精品家庭影院| 精品一区二区在线播放| 在线免费观看视频一区| 亚洲欧洲av一区二区三区久久| 久久国产尿小便嘘嘘| 欧美日韩中文字幕一区| 亚洲三级久久久| 成人高清视频免费观看| 久久人人爽人人爽| 日本vs亚洲vs韩国一区三区二区 | 伊人色综合久久天天人手人婷| 国产成人午夜高潮毛片| 精品国产自在久精品国产| 午夜激情一区二区三区| 欧美性大战久久久久久久蜜臀 | 欧美色综合网站| 亚洲三级电影全部在线观看高清| 成人久久视频在线观看| 国产亚洲综合色| 国产一区二区三区国产| 久久婷婷国产综合国色天香 | 国产三级欧美三级| 高清在线不卡av| 久久久精品国产免费观看同学| 久久99精品久久久久久久久久久久| 欧美老年两性高潮| 日本不卡免费在线视频| 欧美一级艳片视频免费观看| 老色鬼精品视频在线观看播放| 91精品国产欧美日韩| 麻豆国产精品777777在线| 欧美一区二区三区成人| 日本成人在线不卡视频| 精品日韩一区二区三区 | 日本午夜一本久久久综合| 欧美精品xxxxbbbb| 日韩电影网1区2区| 欧美精品一区视频| 顶级嫩模精品视频在线看| 国产精品福利一区| 一本久道中文字幕精品亚洲嫩| 亚洲乱码国产乱码精品精98午夜 | 欧美成人精品福利| 国产高清精品在线| 亚洲欧洲中文日韩久久av乱码| 色老汉一区二区三区| 亚洲mv在线观看| 精品久久久久久久久久久久久久久 | 日韩av在线播放中文字幕| 亚洲国产成人av网|