当前位置:网站首页>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 );
} );
边栏推荐
- LeetCode2_ Add two numbers
- numpy--数据清洗
- Write a ten thousand word long article "CAS spin lock" to send Jay's new album to the top of the hot list
- What are the safest securities trading apps
- 保证接口数据安全的10种方案
- 【原创】一切不谈考核的管理都是扯淡!
- Excerpted words
- Starting from 1.5, build a microservice framework link tracking traceid
- Three. JS introductory learning notes 00: coordinate system, camera (temporarily understood)
- Briefly describe the working principle of kept
猜你喜欢
![[deep learning] semantic segmentation experiment: UNET network /msrc2 dataset](/img/69/9dadeb92f8d6299250a894690c2845.png)
[deep learning] semantic segmentation experiment: UNET network /msrc2 dataset

银行需要搭建智能客服模块的中台能力,驱动全场景智能客服务升级

numpy--数据清洗
Implementation of crawling web pages and saving them to MySQL using the scrapy framework

持续创作,还得靠它!

Cut ffmpeg as needed, and use emscripten to compile and run

15. Using the text editing tool VIM

OpenGL's distinction and understanding of VAO, VBO and EBO

Spin animation of Cocos performance optimization

Gd32 F3 pin mapping problem SW interface cannot be burned
随机推荐
Do not use memset to clear floating-point numbers
Typescript release 4.8 beta
Database exception resolution caused by large table delete data deletion
Runnable是否可以中断
jacoco代码覆盖率
Getting started with webgl (4)
How to understand that binary complement represents negative numbers
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
【数字IC验证快速入门】19、SystemVerilog学习之基本语法6(线程内部通信...内含实践练习)
LeetCode2_ Add two numbers
#HPDC智能基座人才发展峰会随笔
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
How to create Apple Developer personal account P8 certificate
20th anniversary of agile: a failed uprising
leetcode 241. Different ways to add parentheses design priority for operational expressions (medium)
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)
[quick start of Digital IC Verification] 29. Ahb-sramc (9) (ahb-sramc svtb overview) of SystemVerilog project practice
Three. JS introductory learning notes 04: external model import - no material obj model
Whole process analysis of unity3d rendering pipeline
Asynchronous application of generator function