我的BSP分割原始数据和结果格式(基本分割+Portal)

原始数据文件:oribsp

<BSP>
<Materials>
<Material Name="08 - Default" Type="Standard" Texture="Resources\BspScenes\NF\100_1524.jpg"/>
</Materials>
<StructFace>
<Vertices Count="240">
<Vertex Position="0.0 0.0 -100.0" Normal="0.0 1.97569 0.0" TexCoord="0.58325 -0.908682" />
</Vertices>
<SubMeshes Count="2">
<SubMesh MaterialName="02 - Default" SubMeshID="1" UseIndex32="false">
<Face Value="0 1 2" />
</SubMesh>
<SubMesh MaterialName="01 - Default" SubMeshID="1" UseIndex32="false">
<Face Value="126 127 128" />
</SubMesh>
</SubMeshes>
</StructFace>
<DetailMeshes>
<DetailMesh Name="DM_Cylinder1">
<Vertices Count="36">
<Vertex Position="14.0 0.0 -16.0" Normal="1.0 0.0 0.0" TexCoord="0.75 -0.000499547" />
</Vertices>
<SubMeshes Count="1">
<SubMesh MaterialName="03 - Default" SubMeshID="1" UseIndex32="false">
<Face Value="0 1 2" />
</SubMesh>
</SubMeshes>
</DetailMesh>
<DetailMesh Name="DM_Cylinder02">
<Vertices Count="36">
<Vertex Position="-10.0 0.0 -16.0" Normal="1.0 0.0 0.0" TexCoord="0.75 -0.000499547" />
</Vertices>
<SubMeshes Count="1">
<SubMesh MaterialName="03 - Default" SubMeshID="1" UseIndex32="false">
<Face Value="0 1 2" />
</SubMesh>
</SubMeshes>
</DetailMesh>
</DetailMeshes>
</BSP>

结果文件名:*.nfbsp

<BspScene>
<BspMaterials Count="5"> -- 材质表
<Material Name="01 - Default" TexName="Resources\BspScenes\NF\20034242302484698.jpg" />
</BspMaterials>
<BspVertices Count="269"> --原始顶点
<Vertex Pos="0 0 -100" Normal="0 1 0" TexCoord="0.58325 -0.908682" />
</BspVertices>
<BspStructPlanes Count="21"> -- 结构化平面
<Plane Normal="0 1 0" Distance="0" />
</BspStructPlanes>
<BspStructFaces Count="126">-- 结构化三角形
<StructFace Value="0 1 2" PlaneID="0" SubMeshID="1" />
</BspStructFaces>
<BspDetailMeshes Count="12"> --细节模型
<DetailMesh Name="DM_Cylinder1">
<Vertices Count="36">
<Vertex Pos="14 0 -16" Normal="1 0 0" TexCoord="0.75 -0.000499547" />
</Vertices>
<SubMeshes Count = "1" FaceCount="12">
<SubMesh MaterialID="2">
<Face Value="33 34 35" />
</SubMesh>
</SubMeshes>
</DetailMesh>
</BspDetailMeshes>
<BspNodes Count="6">-- Bsp 节点表
<Node NodeType="-1" PlaneID="11" PosChild="1" NegChild="3" />
<Node NodeType="0" PlaneID="6" PosChild="2" NegChild="-3" />
<Node NodeType="0" PlaneID="4" PosChild="-1" NegChild="-2" />
<Node NodeType="1" PlaneID="9" PosChild="-4" NegChild="4" />
<Node NodeType="1" PlaneID="18" PosChild="5" NegChild="-7" />
<Node NodeType="0" PlaneID="16" PosChild="-5" NegChild="-6" />
</BspNodes>
<BspLeafs Count="7"> -- Bsp Leafs叶子表
<Leaf NodeType="0"> -- Leaf 叶子
<StructFaces Count="27"> -- Struct Faces 结构化面
<SubMesh ID="1"> -- SubMesh ID子SubMesh
<Face ID="0"/>
</SubMesh>
</StructFaces>
<LeafDMID> -- Detail mesh ID 细节面
<ID Value="0"/>
</LeafDMID>
<PortalLinks> -- Portal Links 叶子与哪些Portal连接
<Link PortalID="0"/>
<Link PortalID="1"/>
<Link PortalID="2"/>
<Link PortalID="3"/>
</PortalLinks>
</Leaf>
</BspLeafs>
<BspPortals> -- Portals 入口
<Portal LinkLeaf="3 0" >-- Portal 连接
<Vertex Value="-70 50 -60" /> -- Vertex
<Vertex Value="-40 50 -60" />
<Vertex Value="-40 0 -60" />
<Vertex Value="-70 0 -60" />
</Portal>
</BspPortals>
</BspScene>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值