fbx binary formainput not supportedd 怎么解决

Please do not speak English!!! - 网易云音乐
Please do not speak English!!!
带你沉醉在中文歌的心灵世界里!
播放:380次
网易云音乐多端下载
同步歌单,随时畅听320k好音乐
网易公司版权所有(C)
杭州网易雷火科技有限公司运营:POV-Ray: Resources: Links: 3D Programs: Conversion Utilities
&&&: &: &: &: Conversion UtilitiesImporting DEM Terrain Heightmaps for Unity using GDAL | Alastair Aitchison
Spatial / A.I. / Game Development
I know that some folks reading my blog are from the spatial/mapping community, and may have been disappointed that my posts of late have been more influenced by game development and Unity than by spatial data and Bing Maps. Well, good news, spatial fans – this post is about mapping terrain from DEM data! (to create terrain for a Unity game… )
I’ve written a few posts in the past (such as
and ) that have made use of Digital Elevation Model data, such as collected by the SRTM or GTOPO30 datasets, via GDAL into Bing Maps, WPF etc. In this post I’ll be running through a similar workflow to that which I’ve used before, but this time with the target output being a Unity terrain object.
So, here goes:
1.) Get a GeoTIFF file of DEM data. For whole-world STRM coverage, use Google Earth browse of , or download direct from e.g.
I note that King’s have disabled directory browsing on their server so you’ll have to know the name of the SRTM file you want to access)
If you want to preview the data in the DEM file, you can open it up in
(File –& Open –& Open DEM –& Select GeoTiff file). It should appear something like this:
Note that although you can load up GeoTIFF files in image applications such as Photoshop or GIMP, they won’t visualise the geographic data encoded in the file, and you’ll probably just see this:
2.) (Optional) Use
to transform the data to an alternative projection and/or crop it to a particular area of interest. Like all forms of spatial data, DEM data can be provided in various different projections. The STRM data I’m using here is provided in WGS84 decimal degrees, but as it’s data for Great Britain, I’d like to reproject it to the National Grid of Great Britain (EPSG:27700) instead:
gdalwarp –multi –t_srs EPSG:27700 srtm_36_02.tif srtm_36_02_warped.tif
I’ll then crop a 100km2 area from the warped image so that it covers the Ordnance Survey Grid Square “SH”, which includes North Wales and Snowdonia National Park as shown in the red square here:
Here’s the gdalwarp command to crop the image:
gdalwarp srtm_36_02_warped.tif –te 000 000 srtm_36_02_warped_cropped.tif
If you were to view the warped, cropped image in MicroDEM again now, it would look like:
to convert the GeoTIFF file to the raw heightmap format expected by Unity
gdal_translate –ot UInt16 –scale –of ENVI –outsize
srtm_36_02_warped_cropped.tif heightmap.raw
The settings used here are as follows:
-ot UInt16 Use 16 bit channel. Most graphics applications use 32 bit colour images, consisting of four channels (R,G,B,A), each one having 8 bits. That means that, in any given channel, you can only represent an integer value between 0-255. We’ll be encoding the heightmap data in a single channel, so having only 256 unique values would not give us very precise resolution. Instead. we’ll specify a 16bit channel that gives 65,536 unique values instead.
To make the most of our 16 bit channel, we need to scale the height values from their original range to fill the full range of values available in the 16 bit channel (0 – 65535). Specifying –scale with no parameters automatically does this.
-of ENVI  This outputs the result in the raw binary output file format Unity expects.
Unity terrain maps must have dimensions equal to a power of 2 + 1. i.e. 65×65, 129×129, 257×257, 513×513, 25, 49 etc.
4.) Import into Unity
Create a new terrain object and, from the settings tab of the Inspector, click the button to Import Raw heightmap. If you browse to select the heightmap.raw file created in the previous step, it should populate the correct settings automatically (note that, even when running under Windows, gdal appears to use Mac Byte Order). Note that Width and Height need to match the Heightmap Resolution field in the terrain inspector, not the Width and Height of the terrain itself:
If all goes well, your blank terrain should magically update to reflect the heightmap and you’ll see the following:
5.) Correct the orientation
The observant amongst you will notice one slight problem with the previous image – the heightmap has been rotated anti-clockwise by 90 degrees. It turns out that Unity treats heightmap coordinates with (0,0) at the bottom-left corner, whereas most other applications, including gdal, interpret (0,0) at the top-left corner. Fortunately the fix is quite simple. Just attach the following script to the terrain object and click play (changes will be saved to the terrain, so script can be disabled/deleted once used once)
using UnityE
using System.C
public class RotateTerrain : MonoBehaviour {
void Start () {
Terrain terrain = GetComponent&Terrain&();
// Get a reference to the terrain
TerrainData terrainData = terrain.terrainD
// Populate an array with current height data
float[,] orgHeightData = terrainData.GetHeights(0,0,terrainData.heightmapWidth, terrainData.heightmapHeight);
// Initialise a new array of same size to hold rotated data
float[,] mirroredHeightData = new float[terrainData.heightmapWidth, terrainData.heightmapHeight];
for (int y = 0; y & terrainData.heightmapH y++)
for (int x = 0; x & terrainData.heightmapW x++)
// Rotate each element clockwise
mirroredHeightData[y,x] = orgHeightData[terrainData.heightmapHeight - y - 1, x];
// Finally assign the new heightmap to the terrainData:
terrainData.SetHeights(0, 0, mirroredHeightData);
And there you have it – DEM data of Wales imported and ready to play in Unity. Now, if you want, you can texture it using
(or just paint textures on manually).
Like this:Like Loading...
This entry was posted in ,
and tagged , , , , . Bookmark the .
Connecting to %s
Recent Posts
Follow &Alastair Aitchison&
Get every new post delivered to your Inbox.
Join 103 other followers
%d bloggers like this:javascript - Three.js FBX Binary format not supported - Stack Overflow
to customize your list.
Announcing Stack Overflow Documentation
We started with Q&A. Technical documentation is next, and we need your help.
Whether you're a beginner or an experienced developer, you can contribute.
I am working three.js in a javascript based mobile application. I am using .fbx file for 3D model. But its not supporting the binary format in FBXLoader. I don't know much about 3D models and formats. Any help would be appreciated.
Error in console:
FBXLoader: !!! FBX Binary format not supported !!!
here is my loading fbx code:
var loader = new THREE.FBXLoader( manager );
// alert(loader);
loader.load( 'img/watcher.FBX', function( object ) {
alert(object);
object.traverse( function( child ) {
if ( child instanceof THREE.Mesh ) {
if ( child instanceof THREE.SkinnedMesh ) {
if ( child.geometry.animations !== undefined ||
child.geometry.morphAnimations !== undefined ) {
child.mixer = new THREE.AnimationMixer( child );
mixers.push( child.mixer );
var action = child.mixer.clipAction( child.geometry.animations[
action.play();
scene.add( object );
}, onProgress, onError );
If you look at the
or , you can see it says: ASCII and version 7 format
* @author yamahigashi /yamahigashi
* This loader loads FBX file in *ASCII and version 7 format*.
- skinning
- normal / uv
Not Support
- material
An alternative is to use glTF and the , and use the .
Note there is another issue with Binary FBX files, that may cause problem sometimes. In the 2016.0, a change was made to support large file (> 2Gb). This change only affects the binary FBX file format. Those cannot be read with older readers because the file pointers are not of the same size. But for the rest, the files are pretty much compatibles. For sure that does not affect the javascript loader here since I am mentioning this for people using the FBX SDK, but worth mentioning.
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled}

我要回帖

更多关于 format not supported 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信