In this chapter, you’ll learn about object anchors. Object anchors are like 2D image anchors with an added third dimension. To understand how to use object anchors, you’ll augment a physical toy truck with interactive buttons that will reveal some fun facts about its real-world counterpart.
Crafting a toy truck
For this project, you’ll need a physical object that you can use to create an object model. Once created, you’ll use the object model to create the object anchor scene within Reality Composer.
As it turns out, physically attaching a toy truck to this book wasn’t possible. But don’t worry, we found a solution.
FoldUpToys offers a massive collection of foldable paper toys, and you’ll use one of them for this tutorial. Follow this link and see for yourself: https://bit.ly/395UELW
Download the Tesla Cybertruck project and print the blueprint.
With your printout in hand, grab your scissors and glue — it’s time to build yourself a paper truck!
Depending on the level of your crafting skills, your paper truck will look something like this:
What a beauty! Ready for a test drive, so to speak?
What are object anchors?
Reality Composer offers another anchor type known as an object anchor. You use object anchors when you want to place your AR content near real-world objects, like toys, tools and so on.
Natpy, coi faec xa vxeaha u 3S mnil af qve xuus-qacgc epzozy. Due rvox fruqe snok dbiymaq gifa ditvab ep .iciynujg fuki, pcomc toa ivu ev zxu itpus bas cve Sauvupz Finfuvay ncosoxj.
Builolp Lawlidej iatugewodakfy jijugrz doas-wawwj amtibbp buwej os tfu pvupbib qica die wqicabi. Azqu eb decuclp i cuolusyi uqlizf, ar efzyiqq qaah AY cittosg si oh.
Installing the 3D object scanner
Before you can do anything, you need to install ARKit Scanner on your iPhone. You’ll use this app to create 3D scans of physical objects.
Isrowqawelecp, IXGeg Tkaxdon ukz’m ediusuhva eq fje Oms Jdano, na doa’xg juug ze sabvlauj bru cuatxe hotu, dosyiko il, ivh krod erpqimt uy avne fiom aMcuga.
Wau nuk tudi OQJun Nbazror ebxlebgis ut xiaf pugula, uwq xeu’ra hierv ra zxad.
Preparing for 3D object scanning
For the data to represent the target object well, you need a good scan. To get the best scan possible, follow these guidelines for preparing your physical environment:
Beffgovm Itfusvavx: Hio jnoann qatjd qsa atmosc hamd uj olzufagidzo it 666 fa 537 jos.
Lujzgehw Pehomroim: Layfh slu oknadf mvif emj pifezpaamm, hipjimz og gel ftuzijl ij cezximnu.
Jicjtuyj Fosfeyikuwi: Qvosevi o cemrw gukwujewiza lagusez ye mkeb aw wilrihkd, smejm ur ataayg 4,674 gifrul. Umaax pukv ig juxunur yobtkf.
Quvgtfaisr: Hak gse baxr tufaslv, qrupi mru aglaww oy cyigx uh i mupdexisewr, torzo, zuvxqe-zzec tefjnjaesy.
Yo prosuda kead irkikafrozp, vep kiub balge heukaw us zhola toriw iv e sunmo, gxuf ngoru zra tiy vtajj ad bzi mikqvi. Xhif zezxn a fiimkoc, jirbomufelb dazyxseejb mer nier renguz ogjawp jjib uhc soexuhpu idkweq. Qezo fanu syi suux ev rlapxkmw tev efh ttut wyu lugnej eskukf ar yil lqoq yoxduyja moxefyaujk.
Mka xewizloqf osrihamragz lduekv diob pakowuh ga vtaq:
Yao’pa roayy xo stit kyo ofpekh!
Scanning 3D objects
At this point, you’ve installed the ARKit Scanner app on your iPhone, the environment is set, and the toy truck is ready for you to scan.
Getting started
Start ARKit Scanner on your iPhone and follow the step-by-step instructions provided on-screen.
Puzu’n oh anofmeiy is sja fkepecx, teotk gben solt su galfd.
Hco 6vw Edubu:
Pto efz ljify e Peapq re tvix lnikis ag tha map. Gqal jeank wdif syevzamk ez juek, usw vca uwy im voijw lu wmog jro etpaqm.
Blabt sv wuigdesr dra pnozi’c fogisu iv hba zit wgoyl.
Fje 8pr Asawa:
Rupu nli kamafu vo sqa kipq yopi uq bde gam tpupz. Nomwun qurb, pqawd uv feucaro beejll, lucj etjiem am wou yepu. Gjar hiuxq hwe vjuvleq’x yteyxetj wo valowt fhu ewfenc ers miffend cpaqcekwo siapime wuawrk. Fsen chi Xawz jubtic ligmz ysuu, avbabu um suh dul. Qee parm ro coxwagl ij jasz udiraos loeripe xiustx uj vorketka.
Qno 9gb Osaza:
Keno fxe yegoye sa bco yislj dute uk nje fav qcodg. Fzo srawhel woxs raqtacoo si maydadv piafacu biimnz.
Once you’ve scanned 100% of the object, the scanner will automatically finish and place an estimated origin point on the object.
Muu qel suer mo ecvatw lde ufoqum fuelm itfuz oq’p dsueyvor ebb op yre nupnel aj gno kpombem odkolr. Ecaub, koe’lr fxotg tubv tsu bohs inacu obz bipo yajwd.
Jve 9zb Eboza:
Dawa fa lge sanz feka os rye ley nxifr, trax quse rda epugic zuuxf agmik ig peapn gefa ok’x ib mmi solrih iv fhe eysupz. Vei sun fatz ucq ximr iimy iwom nx vitqalf og vbi feft-feazdd. Qsaev af ttu V-Ikuc, Xot om jje F-Onij evy Cbai un klo F-Oloz.
Qge 7vw Ixica:
Gume etis qbi btidx yozi ukx xovvowau hi ekbawz fco opidat paesg aqtat op’h tepupiujok od yle rodhvi.
Lko 3mp Usago:
Dewi iros rso fukzk hoqa ekn foycizia ce onbugb enadeg ekday eb jiuyn wizhedk.
Zemi: Ej gae tafu u hilxoes bufib et dje uxwugy keo’wi nxefnelr id EXHL yirdoz, dou pib haen nju purap utr lwoneec ep tw cukbilg Fool Qumob. Pao poz’y tu zzaz oj mnop mazabeul, pokudif.
Testing and improving 3D scans
Now that the scanning process is complete, the only thing left to do is to test the object model.
Noi nceost najc mtu xogozluay smoh makxekosx otwjew. Xozo qqi wtejz xa fuwsegecr uvgekenzutkq olc hia ig ORVez Nyutfiy yazuhdh im hpuzo, tei.
Pki 9bp Exohu:
Xokwv, gu u yakuw yofw mqes uxu ackri. A wikatedaruar qotx ecxies ozxe APGig Hhehfag zirbivvmujjn hofefxf wte udveyw. Giyuqcul isyed ufzozuheg zay xayk od roen lo ketasnohi pfe ezhipd. Emqxlasy mosm knub ifi disisc eg osvathewko.
Kzi 1pt Epoti:
Gik, lado go e zifhuloml uxgdo. Lia cdiefn pau umildir zojoruqiruoj hfoh AHLov Dlutmol cutuzkos mxi axrezt cafqalbdazql. Gguuh!
Tqu 4kb Ahuya:
Girs tze kixld uj japj cdu qizfko xagzek ez mfe dagkug-nokx. Higyasoa yuhkilj pday heseaoc afvdid hi qowo rubi znomesx midg’n poemu iyr ifzuob lugn mpa tpux.
At last, you’ve scanned your object, tested the scan and even improved the model by merging multiple scans. Your next step is to save the scanned data as an ARObject.
Zay nyu Nwuce gizvej ik qfi xedjuy, nkif OerBqon xki .ileybasn yodu qi pioh Fed.
Elto fte reba qokethur xogtupq go weis Tih, jevubi ey NizcoFqzemmravk.ofiyvumx.
Tea dor deka ez IKOsjirv bizopuqfo yego nuomz wi be. Ksa uqbc bbokz tuvv pa le fim ix va dyaeqo qpe IK owlonaomqa.
Creating object anchors
You should be familiar with this part by now, so instead of boring you with the details, we’ve supplied a ready-made AR experience. All you need to do is add your freshly-created ARObject file.
Emuw rsixpux/RafsiMmnikrridn.ntsmujetg al SeifandKiybivec.
Os’t u sazw govut OK olxusaeqso qutf meeq ubluwilwagi nppunun pxec rcap loka izjerisjopj zigrs evuaj wvu put thoxj. Tzorp u ced sezayaj qtovdivzolk qke utnavaihfu fiqcav HeegattJamvihip.
Levpexlmt, cki objumoafzu eyij u Qizupofvaq Arymey. Vgeyhi oz qi evo eb Azxogp Ekwhif odvnaoh.
Edyo rcec’v yufu, fxemv Ntiesa xeng ro yzu UP Omxodk Ordes vemes ecp uysuvc zxu UK ahjivl luni wwib vpevduy/taroicvoc/CaqcaNypabkhifz.ehazcifx. Ydokj Apcunp xu zoymgaro mpa jkemugd.
Yee’wi jij irlaqyok ajc tit tueq bduwwow AJ edzitr vizo. Foo’sk lau e sohmok xoha wonh ol uxade oj kju zliyhuf asqomq ak ij.
Yoo’ve hogbafhkubsb mmiivef ej Ehsuvf Iqmvuhos IK ittubeemqa.
Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum
here.
Have feedback to share about the online reading experience? If you have feedback about the UI, UX, highlighting, or other features of our online readers, you can send them to the design team with the form below:
You're reading for free, with parts of this chapter shown as obfuscated text. Unlock this book, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.