Josh finds a way đ§
âDad, I want to learn pre-algebra. â chirped 10-year-old Hannah. She was the smartest of the lot. Josh looked away from his computer screen and studied the curiosity in her eyes.
His first thought â âWhy would anyone wanna learn pre-algebra?â
Followed by â âWhat the heck even is pre-algebra? Pre? Algebra?â
So he did what any person sitting in front of a computer would.
And what he saw nextâŚdefined the beginning of the iTwin.js sandbox.
Years passed.
The sandbox was now a reality. And Josh â whose daughter was the reason for its existence â was about to get his first opportunity to use it.
He was sitting in a meeting with â letâs call themâŚXYZ company.
One of the biggest IT firms in India.
They were looking for a way to automatically walk around their 3D models, and give their users a virtual tour of sorts. Think first-person video games â such as Minecraft or Call of Duty.
Thankfully â there was a sample out there that demonstrated this functionality:
âThis is exactly what we need!â announced one of the engineers of the firm, as Josh presented this sample.
âBut one questionâŚhow do we create our own paths?â he added reasonably.
That was an excellent question.
The sample only contained preprogrammed paths â if they copied the code directlyâŚthey would fly off into the middle of nowhere. There was no guidance on how to create your own custom path.
âWell that should be easy,â responded Josh, âit takes in a list of camera positions. You just need to pass in yours to create a new path.â
âAnd how do we create this list?â asked the XYZ engineer.
âHmm, let me think. I bet you could write a simple toolâŚâ Josh stopped talking mid-sentence.
Silence fell onto the meeting.
The words âwrite a simple toolâ echoed through the chambers of his mind.
âWait a second! The sandbox is finally realâŚI can write the tool for you!â
For those of you who havenât guessed yet â Josh is the manager. And the sandbox has long been his dream project.
Ever since that innocent Google search instigated by Hannah. It led him to a website called âKhan Academyâ where he discovered a JavaScript course that was studded with sandboxes.
To Josh, this was the perfect way of sharing codeâŚan embedded editable, development environment that displays the output right next to the source!
Ever since then, it became his mission to bring this into the iTwin.js world. Every meeting that went by â in which a client would request sample code â he would get pangs of longing for the iTwin.js sandbox. Meeting after meeting, request after request â the lack of sandbox was driving him crazy.
Until the meeting with:
They needed to define a custom camera path.
âHow do we create our own path?â asked the XYZ engineer.
And Josh realized:
âThe sandbox is finally real!â Possessed with maniacal joy, he finally set out to do what he had been dreaming for years.
He rushed over to the iTwin.js Sandbox page, clicked on the âCreate new sandboxâ button, and wrote some shareable code. After an afternoon of productive coding, he ended up with the following sandbox.
Itâs a nifty little tool that reveals the exact camera coordinates of a given position. The user can literally walk through their models to generate a path list.
When the XYZ engineers got their hands on this sandboxâŚthey became experts at creating their own paths.
The beauty of this approach is that even though Josh wrote this sample once â anyone can access it, clone it, and extend it. The sandbox is the perfect mechanism for crystallizing sample code. Now â meeting after meeting, when clients request code â it doesn't go to waste. The sandbox playground acts as a fishing net that collects all these samples.
And the best part â each piece of sample code caught as a sandbox becomes highly discoverable. You can add #search #tags to help people find it on the iTwin.js website. All the public needs is a simple click of the search bar.
Speaking of search barsâŚJoshâs dream, and Hannahâs math career, have come a long way since the day of that original Google search (she is now excelling in trigonometry). Josh has high hopes for the future of both. With everything said and done though, there still remains one question to be answered.
Co-authored with Josh Schifter.
â back