Tuesday, 17 May 2011

Parts are made of parts

The recursion is working! Boy did that take some time.

The hardest thing was getting the model to transform so that the selected object occupies the exact same space as it's container once did. This is necessary to facilitate the hand-over from mini-machina to master-machina, where all the transforms are reset but the machina is now drawn relative to the world rather than its master. I knew the transforms necessary to get the mini in it's place, so I thought I could just apply the reverse transformations to the master object and hey presto. But no. After much hair pulling, it turns out that the solution requires applying the reverse transformations in a different order. Some IF statements sorted that out.

Lerp() came to my aid in getting the transforms to ease out, which has a cool effect. It doesn't finish perfectly, but certainly does the job.

The transparency really completes the effect, fading out all the other pieces till there is only the new machina.

In my original design, the user would click on an mini-machina to travel to it and look inside it. Picking in 3D space seems doable, from the example I found here, but I decided to cut the feature due to time constraint. It isn't crucial to my project really, so it's just a 'nice to have', even though I was interested to try it. Instead, the mini-machina is picked randomly when you middle-click, and it only triggers if the object is exploded far enough (trying to minimise clipping and confusion).




No comments:

Post a Comment