Overview

These are notes on how to convert OBJ files to glTF and GLB files.

Target Data

The target is the “Ishibuchi Family Globe” from the “Kikuchi City / Digital Archive.”

https://adeac.jp/kikuchi-city/catalog/e0001

The OBJ file can be accessed from the following URL.

https://adeac.jp/viewitem/kikuchi-city/viewer/3d/dc-e0097/models/Kikuchi_Globe_180820.obj

Downloading the Target Data

Download the library.

npmiaxios

Prepare the following file.

ccca}a}cci}pooossoofrnnnyynnosssFnLnUss(ctttuccc}rr}oct}}stt!fenoo)ee)arafssafpcfnn;st;dfycgoos.sxsatusspuuaebu.mOitinttumrorwwn{ccccfcci}}tcjtekbo=hocreennrrocoooosoofcoeUpxdjsntwrltssiibtnnnn.nnehnxruiiFr=ire,hpenttjiDssSsswsSs(lsaltsri=etoisoo.eeeoottattroetmcccacccf}sc(omDtSlqrontpdndwrrfnwvilatooowooooeoelp=isyerueeo:sa..inooeootermlnnnannnrnrelrSn(eiqddrnetPoolplbbbbe.ctMsssDisGss{sr.e'ycoqruoos'TarnnerojjjjFlhlatttotoett(cccacooeh=n(bueiww=eGy.o((oaRCoFFioMtwltcooowolrrtcoji(rnnEppm''acdeobiilgfacmmmndemtonnnane)rt(uUr'ellf=Teiifenesnjlle(othtttlo..tensssDis.opotref(oos':psirdspteeS`rc)lllowlmlxstttotol{rs/upl(s'aa.a,eenrsooefNPyDhFUFanotCttwlo(:dtu,''pddcw'((iodObnniaano.{iridlgloutttndeg`/pta)aFrasw(srobjstlmtcwm=lllo(nrmeeelo.(EwuDox;taieitrrh'wjeeeh(ntee.a`fteaxxxowl'rantiuihlatrie',nFf=olloN=PmdDieMttttanoNrdlDrto'fetets,lii===bobaatFolnacuuudlgooeoi,ps)i(eaaeorollojafjmntliwetthrrro(raaru';luWxmrlreaeeabppFdiCeehlnceeeta`Mcd){t)erri')vejd(wjaaielowfelc=hoFUFedDTp.s)D;lio,;eseoaaRttlden==i(ooefirixFoLrj'rif,ts,ocrbniehhetUlmanfsllltiwop;{erre(ltejdts..POpemRpetdtsteeulnfc/c)ooS{rv)lUpbjaBantLalee.=eN=Prelievu;mutee;argaoaotJttl(tUdnrxaae(olsirtrj)tlexnsihh.Mmhrte[tmnttaesesapee;e,tisen,fmat.lMa.ueehiediwiuacdoen(iatlj,Tad.rwmxernivstmtois.aooltcFoLnF.e==atdegtepP()fut.dmubechiimdimMUgufe:eaoitsgaetj:h[lntfltamRperteOmctu=lpet(pC(1e(lifeltaLaeerB/tiht>euctaouo$/]NoFliSCct(tUxeJkrf)psto(;btn{^;auienyohcthrtniuiu{DnojDtommtl:dnnehe.lucfkee{titbUiebtepects[xj,reiudPrejrrnjl,uP$r(e)1toedlc}a)nUl,tFlta{emn]uiteh)Uttr))iioDtmltt{;rnefi:i;Rh{l;o;lbbihtal.e(xin-L))be\jr)ltFmFotl$c;;jPsU,;Feiaiuuet{iFa+ridltltr:hetit(lmlecepeerylh.)tefPhNuF$r/e}+.lPiaAati{OovN`)hFaltlmDltBria)$ritehleieeJ.em;/elhs,(,rPxmwemfe},atfee));N`'^otuisr;;a)umbphrls/m;taja)eea3efpUt;F.gd)-_rhi'e/;8Kl.l)}d'd)be;`c).aP)-;shsa;e+ret0(enh0.fa}9+;m`7)e)/$(;m/togedmxe)tl]us;r/eKFiikluecNhaim_eG)l)o;be_180820.obj';

Execute it.

nodedwn.js

The .obj, .mtl, and .jpg files are downloaded to the downloads folder.

Converting to glTF

Download the library.

npmiobj2gltf

Prepare the following file.

cco}oob)nnj;ss2ttgcflosoftn.bsfswj(tr2="ig.dtlr/aetedtFfqoaiuwl=in=erlSreoBye(aunq"dfcufsf(is/e"r"Kr.e)i./(;kfm"uroocodbhmeji(l2_J.gGSgllOltoNtfb.f"es")_t,;1r8id0na8gt2ia0f).y;o(bgjl"t)f.)t)h;en(function(gltf){

Execute it.

nodeconvert.js

A model.gltf file is created.

Converting to GLB

Download the library.

npmigltf-pipeline

Convert the glTF file to a GLB file.

gltf-pipeline-imodel.gltfmodel.glb

Summary

There may be other appropriate conversion methods, but I hope this serves as a helpful reference.