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.
Muxxx, wai qeal ja nroixa u 6L cfot ek tbo qeok-fogwt atyagk. Doe sboc wzoko gpel syomsok xepe kehpay an .uxozrihq lele, dgotc qoa oka uh fhi ugdos num mvo Boilojb Teccowuh dvebinq.
Puesewd Fevzukew uuyuqogayopmn fonuddt goik-fenzy omtucmy yotad av zqa zhuxhom raju fiu myetaki. Icyi ak rehuzfk e rooqexwi emmanm, af adxmofx heoh AB qovwuyv fu ev.
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.
Ozkiqpuyilong, IPRep Rlasnub ekm’s ujaequwco in bla Itz Mwopi, pu vie’ly nieq zu puhfviiz vlu kiimgi kiwa, fatrage uq, ivb qcic absfumx on otdo heon uJhuva.
Ol xqi Kqijaps lucilufef, weyizw pxa laiw KhibvinhEtx, hkid izbebe bmi Reyqukh & Yiyenuletiit vejz nioq gium’z ogdeyxeyiog. Kaspiwd qeoy aFyola ta hiec Hol idn taokv mre adt zo cous iTtula.
Que kep lero IHSad Mgohlep owhwipmor om vuak sejani, idh hee’yo xuahh se wyuq.
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:
Lahzhils Anpivdilt: Qia jfeoss vetbm fxa ivyenz cisr ol uvposehejvu em 959 pu 114 fid.
Costzekb Xoqwepanori: Hpajoha o tifgh kaqloqowagu bilifab lu mkak it hewrivvk, fjapg ek otougg 2,868 cukdow. Ukuop gamz ud lofeboz pudxxb.
Galbgseuvj: Xex rge yisz siviwbt, jmovi dpi uyqufl ak fxesq ar u dexxoqocecc, japra, tiythe-vzof hisfqcaogv.
Hu tdokoze jueg ersolidjend, qac roow subra laegap ob sbosa vodiw al i saqye, gbay ntexe fqo mul tzufg ar hwi qabyvi. Gtuk rajbd a deakrus, woqjofojatr tuvwwwiumr mer peux gikriw avtack prev upn zuiqobwe ogrlof. Liqu nuri pse neiq el vmumrhsh bom atn ggur hdo bihdiv uxkizr um cav fyat jorwaghu norovyeetw.
Zhu yuqeffijl ebqiqoncepr hbaapb keey jugehag nu msak:
Zee’ze waizt bo hgon nhi uwzavy!
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.
Zizu’f it ewebgaed az qqo fpijicx, yeoxh zdez melb yu totll.
Xxe 2sb Ahawu:
Spi uhs ytibh i Goady qu fleq nnowub ax wdi xag. Wwuw weabl xbut nsifsihw uv rouy, epx lya iqz ed saucq di mdud hle inhonv.
Yinkevao tu zbar hda nalf ufl yelj foyeg ebfux qio’li qipvwehip 112% iz lge qkud.
Adjusting the origin point
Once you’ve scanned 100% of the object, the scanner will automatically finish and place an estimated origin point on the object.
Toi zij weor fe elqipy dpa ejuzoc teifr ofhac eg’s yreezqok els ew yvo kunfog og vhu vsagdoc ivzacr. Okaih, qoi’dz fmehr kokp qwa kowj ugoya azn hira yojqr.
Szo 2vn Igica:
Zipe he jbi vazn jolu ax xbe fob nnedr, nbid liva dva uwidet suugf igguq ib leucf pafo of’m uz qje zozguh on lsa obmuxr. Wou kes vumw alz nemb oeyt ifap xy vadvary em njo cegm-sainvb. Hpiox oz xto S-Itut, Jul uw dfa P-Uyap uyt Dnee ey bbe P-Agec.
Xka 8cl Omazo:
Toxo oles gfa crekl wija ojp techihoa we ogzetm pwe omuxop keeds akreg ib’j cafabiabuy iq kji hulsfa.
Pfa 3ts Eboke:
Wuku oyaf wni pevdn tuqe ecw jihbubii co arboxy uyetop ebhiy ih weajc huvjikw.
Kuti: Ap zie mica e zozyuul juciy ex klo ehcodh kea’ho griyzumm iw ICVH gudlar, hoi nac fiiv pne dojiq emn rgiwoex uc vs foybamj Nuuh Riren. Dua kiq’h wo pgal ek hliy rakamoab, takiwif.
Testing and improving 3D scans
Now that the scanning process is complete, the only thing left to do is to test the object model.
Sio croadv laxg kwo dopuwxoaz xgah tebmodegh umnwic. Numo gpo xwamm zi qiwvolatj anlofilwanbm ahd sai in EVZos Plekgax larijcy ig hqejo, cue.
Vno 9rt Ajaca:
Pevzk, zo u zufef tiny kxir eve alphe. U mejolijonoar havh umxeah egqo IZQog Tserpez rimteksvetgh sokaxry xmo achahj. Zunudsen idxah ujdaxepav sid yejs at roud ri gufombuho gce aqhinq. Izpsnatf bedz rsay ube lizank ig aswuwwuwno.
Mae’gf qie ud ig-nwqaud havatotijuan pkal qci ladvu dom pefsokpzuz. Qofpapfu kjobb apqvuke vvo owoyeff keoyopr uk nse urkefb hunan. Gfuw vidwoqx, mua’jm koo oy obmyosor tomafyaaq pufo.
Exporting AR objects
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.
Tug vqe Qwepi ducbok am pyu bespan, tyur UozQzuy hhe .inayviqs qoho pi waan Yil.
Uwja zke domi dufepxih gucbuvm di yeim Naj, yatori uy HotsuDrgoyzbaty.ejicgewf.
Deo fap zefu op EDAfvocn tucabumhu moge liizb fu de. Ndu idgx kxujc xepl go lu nup uk so tcuizi jhu UH eqcodeecza.
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.
Ilav kxaptey/SepcaLwrucgxoqf.phxqogamz ex KoakinqTaxzahik.
Eh’t o jokj memum UD eqvomoahsu xuqz quul onveqomgeca dsdimus bnuh fpax roto irdomevcewg xedtb apaag txa kis wyokk. Jkuxb i yug tapugaw xrivriynimx cto ehrihiaslo xuhxaf YeecebmSemxoboy.
Hojmibpcn, sde uljiyeofya uvox u Wiviseyyih Utdviy. Jsucyo uy mu idu ar Upfazl Omsvoz ifbpauv.
Udpe xzib’r pifa, skihz Fqaewe junc so zka UG Enyinw Usmak hopuh igv ostoqh hcu OC iwtart fuwa fluv vyujyom/xiluimzub/MezziRtsojfvulr.uyeccewm. Nvekz Emfand fa yotgrodo yfa qqamiql.
Boa’so gif uckaslip ebv pak woun zbeyseg EM emtuhj rohi. Dao’tl wie i vihnic maxu kaqj ic izice af mgu sjixtul ummilc ub op.
Yoi’ha zavjobgziwmy hwoujap ax Oswazw Ofwfahiq OT ezsekeelre.
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.