 Sreči, je Ricardo Cagliarducci in je tudi zelo zelo. Kaj je zelo vši vši vrštjev? Vseh nekaj. Vseh je to zelo všim vrštjev. Vseh je zelo vzivati in vzivati in traktivne 3D grafice vziv. Vziv na televiziju. Now we have a real demo going on because a friend is cycling around here in Vondelpark. And we can follow his movements, write his moving. His name is Eduardo that's why the E goes there. It is taking the GPS, rho GPS kill from him and we are moving the marker in real time. So I am connected to a server that gives me a great latitude and longitude. To je vsečo vsečo načinje v Amsterdamu. To je zelo zelo zelo, ker je nekaj hodnji v njom. Vseč je zelo načinje, ker je vrič. Why? Because this is a raw GPS signal. If you look in some up your signal, this signal is often filtered. So it is snapped to the street. It has a prediction on where you will be the next second. And so it seems a smooth movement. But in fact it is not at all smooth. And one more thing, if you take the map from a map service and you try to put it in a blender game engine and you receive the GPS signal, the cursor won't go in the correct position. We will see later why. But this is a special map. And you see, we welcome Eduardo. Thank you very much. Now you can take a rest. Thank you. And so he reached the valley. How the story begins? Wait, still. Four years ago we built a web app that shows territorial data, makes some analysis and calculation about this data. And this job went really, really well. And we showed this app to our clients and our colleagues. So everyone was convinced that we knew everything about GIS, special visualization and interactivity. A colleague came to me, are you interested in a job with Blender? It's just about scripting in the blender game engine, receiving GPS real time coordinates, so we need a three dimensional map, put some markers, allow user, some user to control the point of view and to provide contents, three dimensional map of all Italy. Then he said me, are you able to do the job? And I say, not at all. So you are telling me that you are accepting the job. Yes, of course, I accept in this job. After this we discovered that it was for the Giro d'Italia, the tour of Italy. The tour of Italy is along with the Tour de France, La Vuelta in Spain, one of the main male stage race competition. In Italy is broadcasted by Rai, the national Italian television. Each stage was shown by two million people each day. And with an average share of 18%, it's quite a lot of people. And it's 100 years that this competition exists. In the first edition that we contribute, the edition of 2016, the first three stages were in Holland. Who are the people involved in this work? Giro d'Italia gave the responsibility to MicroPlus of all the broadcast, the data management, the timing and the final broadcast. The studio in the name of Ricardo Covino, that some of you may remember, did a huge part that was used for some years. But in the two years ago, he asked us, Bricksell, Ricardo, Luca and Federica, to provide an additional visualization. This is what you are seeing here in the back. This is a real stage. And we had two people that helped us to complete the work. That is Stefano Penza. Without him it wouldn't be possible, the creation of this content, to mix together them data, digital elevation model, OpenStreetMap data and all in GIS software that helped us with the modeling. How it works? MicroPlus developed a software that collects all the data, timing events, database, archive with all the names of the teams, of the athletes, when they are born and how they are tall. Input, manual input, and also receive input from some physical button that exists close to the TV director during the live stream. Also received the GPS transponder that is under the seat of each bike. And it gives us the X and Y position, latitude and longitude. This software controls Blender game engine. A little bit what I am doing now with a remote controller and what we have been doing with Eduardo. We are controlling remotely the Blender game engine. The Blender game engine output the stream that goes, we together with the live stream in the video mixer and the TV director decide what to show and flows in the television broadcast in the internet. And the main broadcast was done by Rise Sport. How Blender game engine can support this output? The Blender game engine was modified in three principle parts. Alpha support is dual with key and fill output, interlaced output and fixed frame rate. So we cannot have a delay like in a video game, but we have a deadline each 20 milliseconds. So all the calculation should stop before 20 millisecond past. Let's see a little bit of the final result. This is a part of the stream and the caption that you are seeing on the top left and on the bottom is Blender. There are Blender scenes superimposed in the stream. Everything is controlled by scenes and markers. Each marker defines the start and animation, the pose of animation and the ending of animation. Graph plus, the software that controls Blenders is also the one that is constantly updating the texture. What you are seeing here is an updating texture that is switched and provides the correct content. There are a lot of types of scenes. There are a huge amount of scenes that we are seeing. And this one was of 2017, the last day, the last edition. And this is the special scene we built. So you can see in real time the position of the bike and on a three-dimensional map. Oh, I'm sorry. Let's see if we can continue. We can see in real time. The viewer can evaluate how are the team in that moment. This is another ranking done by a scene in Blender. And in the last edition, we also added, now we will see in a second, an additional frames in which you can put the live stream. And this is one, two, three, four. Those are four Blenders scenes composed together in this scene, in this total scene. A demonstration of these frames is this. You are seeing it real time. So one scene is looking at the target. This is three-dimensional and is pointing the arrow. The other marker is not present, so the arrow is gone. Now let's see what are the main, the important challenge that we have to face to complete this kind of work. First, as I told you before, is projection. So this is a map of Amsterdam. And on the left, you see the map represented in a Cartesian plane in Blender, but with geographical coordinates. Geographical coordinates are expressed in degree. That means 4.8° from Greenwich and 52° from Equator. This is called word geographic system, and it cannot be represented on flat surfaces because it is a spherical representation. And as you know, it's impossible to perfectly unwrap a sphere on a plane. So we have to project it in some different way. We picked one that you see on the right. It's called universal transverse mercator and divides the globe in 60 parts. This is the number 31 when we are in Italy. We are using 32 or 33. And the angles, in that case, are preserved. You pick the projection, there are different projections if you want to maintain distances, if you want to maintain angles, or if you want to maintain surface areas. These locally preserve angles. If you measure an angle, it is as represented in the map. The right one is what we call the correct one. Then this is a nice challenge that we have to face. Personally, I have to face it because I developed this software twice. The first time I developed, I developed any work so smoothly. I sent almost everything. I sent to the client and he said me, no, it doesn't work. Why doesn't it work? Because it should run in a blender game engine. So in a blender game engine, no mu module named BPI. Once I was aware of these, I had to redevelop everything to work with the game engine. I asked myself why there is this kind of division. One of the answers I gave myself is performance. The same calculation in a blender was done in 18 milliseconds average. In the blender game engine, two or three milliseconds. It takes two or three milliseconds to compute these. So I am really relaxed with the 20 milliseconds deadline. Decreation of each stage is quite complex. Everything starts from a GPX file that is an XML list of points that we take. We put in GIS software. We collect open street data. You can see there is a river. And from other open data, we collect also the urbanization, that is the gray part. All the village, the city, and little town are drawn gray. And then we take digital elevation model data. Everything, every stuff that we collect, we have to project in UTM projection. So it fits all together. Then we make some work and then we have the final result. Camera movements. The camera movements, the setup is quite easy and we just define the distance from a target, the director can choose a target, can pick a target, the rotation and the height. And then we do all the trigonometry to find the correct camera position. With interpolation, you can have quite nice movement and the setup is really easy. Another problem was the level of detail. One stage is 150, 200 kilometers long. The bounding box can be more than 100 kilometers. The precision that we want is 20 meters. So we quickly reach 30 million vertex and even more. So we create a map with a level of detail, kind of level of detail, very precise close to the path that is the gold one. And as you go further, there are less and less vertex because we are not interested in what is very, very far. The path has a precision of 20 meters, is calculating the Z. The Z is in fact center with the GPS signal, but it's fake. It has a precision of plus or minus 100 meters. So we cannot really trust it. So we use the library, exceptional library, PyQ3, and we take the road that is a separate mesh. We insert in this Q3 and you retrieve just the triangles that we need to check for intersection. Then we can send an array and in 20 triangles, maximum, we find the exact intersection. It's a really nice function in Blender game engine. And last challenge. First, geographical dimension. I already told you some numbers, but to seeing it is more nice. This is one marker that you are seeing here and a real bike is so small. So everything has to be very, very big. The creation of the place names, you see every town has its own place names, is done starting from GPX that has a track point and way point, so I have the name of the town is passing by. We create a CSV and we split the workflow. Photoshop action is giving me all the PNG file with a nice shadow, nice font. And we put it back in Blender with a Python script that repeat the same process that we saw to place correctly marker and place names at the correct height. And then you have all the names along the path. To close, what is missing or what could facilitate this kind of work. First of all, huge coordinate support. There are some problems when I try to edit a point that is like 50,000 km away from zero. Blender has some issue. And another part that could be really nice to improve is an easy database connection. We try to put every part of Italy in postgres, postgis database but then we have troubles. So now each stage is a blend file. Separate blend file. And in the Blender game engine is mainly free part. The working mask material. Currently there are some issues. Custom output, so the possibility to have an alpha interlaced and maybe a fixed frame rate option. And basic Bezier. There are some kind of Bezier that we can use but was not feasible in this occasion. And the last part that is missing that I think everybody is really interested in it is BGV, that is the integration of all the work that is being done for EV in the Blender game engine. Thank you. And thank you to Eduardo. Bye.