# Travelling lights, FireMonkey 3D

Posted on in Blogs
When I was travelling around CIS countries (Uzbekistan, Georgia, Belarus, Ukraine), I saw some really beautiful places and structures. Look at a pair of videos to see what impressed me plenty: Tbilisi (Georgia) TV tower, Minsk (Belarus) library. I tried to reproduce the similar “travelling lights” effect with FireMonkey. Truly speaking, I was totally unsure I would succeed, but this is FireMonkey! It means, if you have an idea, there are no obstacles to try it. No extra efforts to try with RAD methods for 3D programming.

I’ve simply created 3 verges of a cubic structure with TPlane (FireMonkey 3D component), and then have been having a great fun with programming “travelling”. I’m just switching the “material source” property for every plate. This is a fundamental change in FireMonkey 3D, as now “material” is a separate object of three possible types.

If you want to make something alike or prototype your way of Christmas lights for your house, use the following tip. Test your color switch scheme on small structures 10x10x10 or even planar 2D. And then use Mac (as I did to record the video) , which showed much better performance for 3D with more “light-like” colors.

• Thursday, 29 November 2012

"Truly speaking, I was totally unsure I would succeed, but this is FireMonkey!"

I can second that experience ...
3D programming gets much easier with firemonkey ...
https://www.cybertribe.de/druid/index.php?q=de/node/63

• Vsevolod Leonov Thursday, 29 November 2012

Thanks, Roland!
A very good example of 3D FireMonkey nice add-on to classical algorythm, not only to illustrate the solution, but primarily verify the correctness of the code.
(of course, knapsack solution is not an algorythm, if we are speaking excact mathematical language, it's a "greedy" solution - as far as I got the first part of your video, when first bigger boxes are located, putting aside samller ones).

I'd like to ask you to share your demo to Russian Delphi users. Can I somehow take your post, translate into Russian and publish there with all the references to you and your original post? No all in Russia are quite strong in English (as for me, I can understand your Deutsch quite well, even gesprochen ) But I'd like your video, algorythm and Delphi realization be known and discussed in Russian Delphi community.

• Thursday, 29 November 2012

Hi, Vsevolod.
You are right - it is very helpful to see your heuristic and visually reckognize that your code is doing th wrong thing :-)
FMX2 is somhow "What You See Is What You Code" - WYSIWYC .
Considering codesharing - my code needs heavy refactring - I would like to get into direct contact on this with you. Twweted to you.

Best regards

Roland

• Thursday, 29 November 2012

• Thursday, 29 November 2012

BTW the placement-strategy can be modified in the application.
The allgorithm is the 3D corner allgorithm best described by this paper:
http://www.cs.nott.ac.uk/~mvh/papers/mvh-draft-ecj2011.pdf

Considering code: I did not mean I won't share. But I need to tidy it up - before it will be useful. Don't know - when I will find time. Lets get into contact about it.

• Vsevolod Leonov Thursday, 29 November 2012

I didn’t mean sharing the code, I only asked your permission to translate into Russian and re-post (no matter where, if you wouldn’t mind right here with the link to your en/de version), so then Russian Delphi blog aggregator could grab it.

Thanks for the link to pdf!

• Thursday, 29 November 2012

Ah - sure you may do so - if my russian would be better - I could save you the work ;-)

"Приятных выходных"

• Vsevolod Leonov Thursday, 29 November 2012

Danke sehr!
The only question - how to embed your video? For this current blog engine (WordPress) you-tube is ok. Can I have the you-tube link to your video?

• Thursday, 29 November 2012

It is not up on youtube ...

Ihr Browser kann leider keine eingebetteten Frames anzeigen:
Sie können die eingebettete Seite über den folgenden Verweis
aufrufen: https://www.cybertribe.de/videos/binpacking/binpacking.html" rel="nofollow">Zeit Online API 1

• Thursday, 29 November 2012

Oops - wrong link in the comment. Can you iframe in the blog?

• Vsevolod Leonov Thursday, 29 November 2012

• Friday, 30 November 2012

Hi.
I made a new screencast in english with callouts.
Enjoy ;-)