Converting a GIS Shp File to FBX format

 

It has been 2 years since I started my work in *.shp format. In the same time, I produced couples of tools to convert them for different software and format.

1.       Converting the building top view in shp file to a graphic engine format so that we can load it directly from engine.

2.       A plugin for 3Ds Max to import Shp file to max model.

Since I am new comer to FBX team, I decided to make a converter to turn shp file to FBX format.

First, we have to know FBX is more for animation propose because it is the original format of Motion Builder.  So, building meshes through FBX SDK is a tough job for new users.

In this passage, I want to talk about the difficulty I was encountered when programming my tools. Hope this will help you out a little bit.

1.       There is no predefined and custom vertex format. If you want have position, uv, normal, binormal, tangent, vertex color, etc in FBX mesh, well, you need to build them layer element  by layer element. (Layer Element is a key concept in FBX which means a component of sth, e.g. A mesh can have normal layer element , vertex color layer element  , diffuse channel layer element  , etc.). After the gathering of all elements, u can put them in a layer and element between layers can “mixed” or “blend” together somehow. E.g. Texture element in different layers can blend with each other.

2.       The Concept of Textures, materials and mesh. In most DCC and 3D rendering Engine, textures belong to materials, which can be applied to multiple meshes. However,  textures are applied to polygons on meshes directly with ID or Value(By IndexArray or DirectArray) and materials only have the properties like colors, shinness.  In the current version (2006.11.1) of SDK, there is not shader in file. But I am pretty sure even you have shaders in material.

3.       How to share materials and textures? For material, you can setup couples of material layer elements. Then call the SetMaterials of Layer. For textures, well, it is a little bit complicated. You need to setup an array to hold your textures, create texture layer element in each mesh, add necessary textures to layer element, calculate back the index of texture in the layer element, Set the texture index for each polygon.

Here is the screen shoot, take a coffee and enjoy…

转载于:https://www.cnblogs.com/eric720/archive/2008/03/20/1115179.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值