当前位置:网站首页>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 );
} );
边栏推荐
- There is a cow, which gives birth to a heifer at the beginning of each year. Each heifer has a heifer at the beginning of each year since the fourth year. Please program how many cows are there in the
- 居然从408改考自命题!211华北电力大学(北京)
- 保证接口数据安全的10种方案
- 2. Basic knowledge of golang
- UE4 exports the picture + text combination diagram through ucanvasrendertarget2d
- Summary of knowledge points of xlua hot update solution
- Align individual elements to the right under flex layout
- What is Base64?
- 2. Heap sort "hard to understand sort"
- 无线传感器网络--ZigBee和6LoWPAN
猜你喜欢
Implementation of crawling web pages and saving them to MySQL using the scrapy framework
webgl_ Enter the three-dimensional world (1)
[quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)
【数字IC验证快速入门】18、SystemVerilog学习之基本语法5(并发线程...内含实践练习)
Briefly describe the working principle of kept
一大波开源小抄来袭
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
Zhongang Mining: Fluorite continues to lead the growth of new energy market
Use cpolar to build a business website (2)
[Lanzhou University] information sharing of postgraduate entrance examination and re examination
随机推荐
Async and await
Align individual elements to the right under flex layout
使用Scrapy框架爬取网页并保存到Mysql的实现
【数字IC验证快速入门】19、SystemVerilog学习之基本语法6(线程内部通信...内含实践练习)
How to understand that binary complement represents negative numbers
MongoDB数据库基础知识整理
HW初级流量监控,到底该怎么做
Shader Language
Tkinter after how to refresh data and cancel refreshing
2022全开源企业发卡网修复短网址等BUG_2022企业级多商户发卡平台源码
2. Heap sort "hard to understand sort"
How to build your own super signature system (yunxiaoduo)?
Detailed explanation of Cocos creator 2.4.0 rendering process
【微信小程序】Chapter(5):微信小程序基础API接口
How to deploy the super signature distribution platform system?
Three. JS introductory learning notes 05: external model import -c4d into JSON file for web pages
避坑:Sql中 in 和not in中有null值的情况说明
[wechat applet] Chapter (5): basic API interface of wechat applet
webgl_ Enter the three-dimensional world (1)
Gd32 F3 pin mapping problem SW interface cannot be burned