Monday 20 April 2020

Rabbits in PowerBI Custom Visual

My inspiration..

My inspiration for this Visual and Blog post is the Aquarium PowerBI Custom visual by ENLIGHTEN DESIGNS.  This visual won the peoples choice award in Microsofts Power BI Best Visual contest.  The contest was used to encurage development and inspiration of new visuals and help promote the PowerBI product.  The Aquarium was simple and fun.

I had a long struggle learning key concepts of 3D programming with WebGL and THREE.JS and furthermore getting this to work inside of PowerBI.  But the results were worth the pain, sweat and tears.

So why Rabbits in PowerBI?.. 

For me, I wantted to making something fun, just like the Aquarium visual or Rockets bouncing around the screen.  So I first considered sheep, playing on the idea that counting sheep puts you to sleep.  However, when looking for a free or low budget sheep 3d model, I was disapointed with my findings.  But, I quickly switched to the idea of rabbits.  After all, they might be more appealing than sheep and can multiply.
Rabbit 3D Model

So, I found a low cost 3d model of a rabbit complete with animations.  The model was amazing, I can't credit the artist/modeler enough.  But the animations where in seperate files and I did not know how to either combine them or load the multiple files as one model.  Later, this turned out to be a blessing.  There are file size limits which I don't know how to get arround.  My attempts to combine the files resulted in large files which I then could not include in PowerBI.  So multiple smaller files worked better once I learnt how to using them togeather.

The visual and code was simple.  I encodd the model, textures and animations as base64 encodings of there original formats (I used FBX for model and animations.)  On Visual constructor, I load decode the base64 strings to load the model, textures and animations into memory.  
3D Rabbits Visualisation
I use a timer to randomly select a rabbit to animate.  The animations avalible can be controlled in the settings.  The rabbits also support tooltips and selection.

Upon Visual update, I recalculate the color and size of all rabbits alread in the scene.  Then I add any additional needed rabbits or remove any extra rabbits.  The rabbits can also be colored to help visually identify categorisation.  Or, a colored spot can be placed below the rabbit.
3D Rabbits Visualisation Colors
It's not a serius visualisation, but was a fun learning project for me.  If I get a chance to work on this visual again, then I would like to make the rabbits also walk around the screen and perhaps add a more visually pleasing grass or field for the rabbits to play.

No comments:

Post a Comment