当前位置:网站首页>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 );
} );
边栏推荐
- 使用Scrapy框架爬取网页并保存到Mysql的实现
- [Lanzhou University] information sharing of postgraduate entrance examination and re examination
- Do you know the relationship between the most important indicators of two strong wind control and the quality of the customer base
- Steps to create P8 certificate and warehousing account
- MongoDB数据库基础知识整理
- MongoD管理数据库的方法介绍
- Share the technical details of super signature system construction
- OpenGL common functions
- 从 1.5 开始搭建一个微服务框架链路追踪 traceId
- 【原创】一切不谈考核的管理都是扯淡!
猜你喜欢
[wechat applet] Chapter (5): basic API interface of wechat applet
MongoD管理数据库的方法介绍
居然从408改考自命题!211华北电力大学(北京)
一大波开源小抄来袭
【数字IC验证快速入门】25、SystemVerilog项目实践之AHB-SRAMC(5)(AHB 重点回顾,要点提炼)
Iterator and for of.. loop
全日制研究生和非全日制研究生的区别!
Syntax of generator function (state machine)
Super simple and fully automated generation super signature system (cloud Xiaoduo minclouds.com cloud service instance), free application in-house test app distribution and hosting platform, maintenan
2. Heap sort "hard to understand sort"
随机推荐
【微信小程序】Chapter(5):微信小程序基础API接口
nodejs package. JSON version number ^ and~
[wechat applet] Chapter (5): basic API interface of wechat applet
Gd32 F3 pin mapping problem SW interface cannot be burned
Implementation of crawling web pages and saving them to MySQL using the scrapy framework
Spin animation of Cocos performance optimization
Use of SVN
C Alibaba cloud OSS file upload, download and other operations (unity is available)
【數字IC驗證快速入門】26、SystemVerilog項目實踐之AHB-SRAMC(6)(APB協議基本要點)
持续创作,还得靠它!
Three. JS introductory learning notes 07: external model import -c4d to JSON file for web pages -fbx import
Create lib Library in keil and use lib Library
Three. JS introductory learning notes 03: perspective projection camera
大表delete删数据导致数据库异常解决
How to deploy the super signature distribution platform system?
2. Basic knowledge of golang
HPDC smart base Talent Development Summit essay
从 1.5 开始搭建一个微服务框架链路追踪 traceId
The difference between full-time graduate students and part-time graduate students!
Summary of knowledge points of xlua hot update solution