当前位置:网站首页>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 );
} );
边栏推荐
- The rebound problem of using Scrollview in cocos Creator
- Ida Pro reverse tool finds the IP and port of the socket server
- 一大波开源小抄来袭
- 居然从408改考自命题!211华北电力大学(北京)
- [wechat applet] Chapter (5): basic API interface of wechat applet
- HW primary flow monitoring, what should we do
- [quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)
- Oracle control file loss recovery archive mode method
- The bank needs to build the middle office capability of the intelligent customer service module to drive the upgrade of the whole scene intelligent customer service
- Webgl texture
猜你喜欢
Zhongang Mining: Fluorite continues to lead the growth of new energy market
Steps to create P8 certificate and warehousing account
Getting started with webgl (4)
保证接口数据安全的10种方案
【兰州大学】考研初试复试资料分享
【数字IC验证快速入门】23、SystemVerilog项目实践之AHB-SRAMC(3)(AHB协议基本要点)
Getting started with webgl (1)
Syntax of generator function (state machine)
2022 all open source enterprise card issuing network repair short website and other bugs_ 2022 enterprise level multi merchant card issuing platform source code
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)
随机推荐
What are the safest securities trading apps
Getting started with webgl (3)
webgl_ Enter the three-dimensional world (2)
Function: JS Click to copy content function
使用Scrapy框架爬取网页并保存到Mysql的实现
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
全日制研究生和非全日制研究生的区别!
Learn good-looking custom scroll bars in 1 minute
The significance of XOR in embedded C language
Iterator and for of.. loop
Cocos creator collision and collision callback do not take effect
Syntax of generator function (state machine)
【数字IC验证快速入门】20、SystemVerilog学习之基本语法7(覆盖率驱动...内含实践练习)
2022 all open source enterprise card issuing network repair short website and other bugs_ 2022 enterprise level multi merchant card issuing platform source code
TS typescript type declaration special declaration field number is handled when the key key
Actually changed from 408 to self proposition! 211 North China Electric Power University (Beijing)
LeetCode2_ Add two numbers
Typescript release 4.8 beta
Share the technical details of super signature system construction
Getting started with webgl (4)