当前位置:网站首页>Three. JS introductory learning notes 18: how to export JSON files with Blender
Three. JS introductory learning notes 18: how to export JSON files with Blender
2022-07-07 15:49:00 【Jiang Duoduo_ Mostly Harmless 】
Reference tutorial :
https://www.jianshu.com/p/f7b45d9b957b
Need to be in blender Install Export three.js Plug in for
blender need 2.79 Version is OK

Method 1: hold js Put in web page
Reference tutorial
https://blog.csdn.net/cj9551/article/details/80307426
https://www.jianshu.com/p/f7b45d9b957b
Webgl In the project , If a larger model is involved (obj,fbx,json etc. ), Tens of megabytes , Hundreds of megahours , Loading time is also unpleasant , and JSON Format model can effectively reduce the size of the model , Speed up loading .
The first method threejs Script
Threejs There are plug-ins on the official website , Support obj and fbx Format of the model into Json Format , The plug-in github The address is https://github.com/mrdoob/three.js/tree/dev/utils/converters, You need threemaster.zip Download to computer , Find the tool from the decompression ,zip Download address
https://codeload.github.com/mrdoob/three.js/zip/master
Usage method :
1、 install node Environmental Science It is not stated here Tutorial links https://www.runoob.com/nodejs/nodejs-install-setup.html
2、 Transfer what you need to format obj or fbx Files in three.js-master\utils\converters Next , Press shift Single right mouse button , Select open the command window here , Enter :obj format conversion :node obj2three.js objname( Yours obj Name of file ).obj ,fbx:node fbx2three.js fbxname( Yours fbx Name of file ).fbx Press enter to generate the corresponding Json file
fbx Models cannot be mapped , If you turn with a map, you will report an error ,Blob is not defined The error in this method has not been solved yet
The second method :Blender export
Blender Download address :https://www.blender.org/download/ Download on demand
Export plug-in download :https://pan.baidu.com/s/1k9KAo9pRfV-aAeasDl9I7A
Extraction code :niri
among io_three yes json Export plug-ins , Yes gltf Is export gltf Format plugin
Plug in installation tutorial :
1、 Installing a plug-in
Add the downloaded plug-in and decompress , take io_scene_gltf2,io_three Two folders , Put them in your blender Installation directory ,Blender\2.79\scripts\addons
2 、 Add plug-ins
Reference tutorial
https://www.jianshu.com/p/f7b45d9b957b
start-up Blender , File -> User Preferences -> Add-ons -> Inquire about Three, Check Import-Export: Three.js Format
Now editing - In preferences

Save User Settings( preservation ).
gltf Plug-in loading 
Click Save to export , You can use it. 3dmax Create a new one cube, Add the map by yourself , Then export the most basic with mapping 3ds Format , And then in blender Import this 3ds file , then Point file – export –threejs-json You can export

OK, the model is exported , Next, let's load it :
var objectLoader = new THREE.ObjectLoader();
objectLoader.load("../model/eee.json", function ( obj ) {
console.log(obj);
scope.obj=obj;
obj.scale.set(3,3,3);
scene.add( obj );
} );
边栏推荐
- Starting from 1.5, build a microservice framework link tracking traceid
- Connecting FTP server tutorial
- 使用cpolar建立一个商业网站(2)
- 【数字IC验证快速入门】20、SystemVerilog学习之基本语法7(覆盖率驱动...内含实践练习)
- Postman generate timestamp, future timestamp
- 【数字IC验证快速入门】25、SystemVerilog项目实践之AHB-SRAMC(5)(AHB 重点回顾,要点提炼)
- Please supervise the 2022 plan
- Window环境下配置Mongodb数据库
- [quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)
- LeetCode1_ Sum of two numbers
猜你喜欢
MongoD管理数据库的方法介绍

【微信小程序】Chapter(5):微信小程序基础API接口

Gd32 F3 pin mapping problem SW interface cannot be burned

After UE4 is packaged, mesh has no material problem
![[quick start of Digital IC Verification] 29. Ahb-sramc (9) (ahb-sramc svtb overview) of SystemVerilog project practice](/img/f7/03975d08912afd8daee936799e8951.png)
[quick start of Digital IC Verification] 29. Ahb-sramc (9) (ahb-sramc svtb overview) of SystemVerilog project practice

Getting started with webgl (4)
![[quick start of Digital IC Verification] 20. Basic grammar of SystemVerilog learning 7 (coverage driven... Including practical exercises)](/img/d3/cab8a1cba3c8d8107ce4a95f328d36.png)
[quick start of Digital IC Verification] 20. Basic grammar of SystemVerilog learning 7 (coverage driven... Including practical exercises)

15. Using the text editing tool VIM
Window环境下配置Mongodb数据库

【数字IC验证快速入门】19、SystemVerilog学习之基本语法6(线程内部通信...内含实践练习)
随机推荐
一大波开源小抄来袭
Ida Pro reverse tool finds the IP and port of the socket server
Super signature principle (fully automated super signature) [Yun Xiaoduo]
2022全开源企业发卡网修复短网址等BUG_2022企业级多商户发卡平台源码
MongoD管理数据库的方法介绍
The "go to definition" in VS2010 does not respond or prompts the solution of "symbol not found"
Three. JS introductory learning notes 03: perspective projection camera
Getting started with webgl (3)
Getting started with webgl (1)
大表delete删数据导致数据库异常解决
Syntaxhighlight highlights the right scroll bar
Connecting FTP server tutorial
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
Cocos creator collision and collision callback do not take effect
【数字IC验证快速入门】29、SystemVerilog项目实践之AHB-SRAMC(9)(AHB-SRAMC SVTB Overview)
Introduction of mongod management database method
Webgl texture
Shader Language
Getting started with webgl (2)
【数字IC验证快速入门】18、SystemVerilog学习之基本语法5(并发线程...内含实践练习)