3D Scanning Using Kinect

7. October, 2011

3D modelling strains my patience. It just takes too long to get even simple models “right”.

There is a new project called surfacerecon which uses the Kinect 3D controller to create fully textured 3D models of real objects.  Seeing is believing:

Jazoon 2010, day 3

7. June, 2010

The last post of the series (day 1, day 2).

The Gaia satellite and Data Processing by William O’Mullane

The day started with some astronomy. Gaia is another effort for a complete sky survey (like it’s predecessor Hiparcos). It’s a “cheap” mission by ESA which costs “only” 600 Million Euros (most space missions start at 1 Billion). It’s interesting how they keep pushing the limits today. Gaia will orbit L2, 1.5 million km away from Earth (the Moon is only 300’000km away). If something goes wrong, there is no way to fix it (which is why most systems are redundant except for the main mirror, for example). The main camera has 170 CCD chips. A huge effort is taken to determine the exact position of the satellite, it’s rotation speed, precise orientation, the position of the components (like the main camera in relation to the main mirror).

It will generate such an enormous amount of data that most of it will have to be thrown away on the craft before it is downloaded. The data will be available to anyone … anyone who can store a couple of petabytes at least (1 petabyte = 1000 terrabytes).

The mind boggles 🙂

Essentials of Testing: The Tools You Need to Know by Bettina Polasek and Marco Cicolini

My topic 🙂 The talk showed how they selected a couple of tools from all the available ones out there by functionality, how they support and complete each other and how well they are supported. Here is the list they came up with:

  • jDepend to know who uses what
  • GlassFish as a means to run J2EE tests out- and inside a container
  • HtmlUnit for testing web pages outside the browser (faster than Selenium but doesn’t catch all kinds of errors)
  • Selenium for testing web pages inside the browser. Slower than HtmlUnit but can test browser specific quirks.
  • PMD to keep your code clean.
  • FEST stands for “Fixtures for Easy Software Testing” and is a library to make testing more simple. For example, you’ll find code here to test Swing UIs or mock the classes you need outside the scope of your test.
  • Mockito, a mocking framework. It takes mocking to the next level with fluent interfaces.

Rapid Application Development with Apache Wicket by Andrew Lombardi

Again a tough one. I’d have loved to attend Using Software Metrics to detect refactorings by Thomas Haug.

Wicket is another web framework for Java. “Why another one?” I hear you wail. Because they all suck? Being an Apache project, Wicket tries to suck less. It’s fully mavenized and builds upon a component framework (the simple ones are built in and you find extensions on wicketstuff.org).

Wicket revolves around the idea that you give it a plain HTML (with almost no extensions) and a piece of Java which connects parts of the HTML with the code so you can simply render your pages from these components.

I’m not 100% sold, yet. Wicket was started around 2005 and has been under the radar most of the time. This can mean that it doesn’t solve all the problems. We’ll see.

Lunch break.

Building DSLs with Eclipse by Peter Friese

I’m a huge fan of code generation. A lot of code that we write is actually pretty repetitive and I really miss my preprocessor from the good old C days. Of course, today, it’s called Model Driven Development and we use XML and model transformation and EMF and the like but still.

Peter showed how to build a small DSL with Eclipse Xtext and generate code with the help of Xpand.

Kids, when you play with DSLs, always remember:

  1. They should be limited. Don’t build general-purpose programming languages with it. Less is more (less time spent debugging and hair pulling in this case).
  2. Know what you want to achieve. The tools won’t help you there.
  3. Know your tools. You can write Towers of Hanoi in SQL but it’s not as much fun as using JavaFX instead.

After the talk, I had a long chat with Peter about DSL debuggers. To make them work, we must have (at least) the following information:

  • Position in the input stream
  • Which DSL rule was applied
  • Which template contributed code
  • The state of the session at this time (values of all parameters, etc)
  • All user supplied transformations which were applied
  • Position in the output stream
    1. Only this huge amount of data will allow us to create meaningful “stack traces” if we want to debug DSL modeling problems.

      Spring ROO – A New Level of Enterprise Java Productivity by Eberhard Wolff

      I skipped most of the talk because I juggled ideas with Peter about DSL debuggers.

      Most of my problems are still there and will be solved by Roo 1.1 (couldn’t find out a release date for that).

      My major objection with Roo: It actually generates all the code. With Grails, for example, I get a controller but the class is empty. This makes it obvious where the defaults are being used. Roo, OTOH, copies a whole slew of code and files into your project when you create a new controller. This is code that you don’t know but which you’ll have to maintain.

      High Performance File IO: the Perl/Java battle by Daniel Eichhorn and Stefan Rufer

      How well does Java fare against Perl when it comes to filtering files if you use NIO? It seems that for big files, say 500MB, Java is just 25% slower which amounts to 24s vs 19s. 24 seconds to process a 500MB file twice isn’t that bad, is it?

      Mifos – the Grameen Foundation’s Java-based Microfinance application by Michael Vorburger

      Motto: Making the world better one line of code at a time. If you heard about microfinance, this is a software which helps to run it. Next time you find yourself with some time at your hands, how about helping fight poverty and join the Mifos open source project?

      Software in the service of handicapped people: Research & Development at Otto Bock by Hans-Willem van Vliet

      Along the same lines as Mifos, Otto Bock tries to make the world better by helping disabled people with wheelchairs and prostheses.

      It was interesting to hear how complex something like a smart leg is and how much people still want to look like everyone else.

      And That’s a Wrap

      With that, Jazoon 2010 ended. For me, it wasn’t as exciting as the last three years, mainly because the keynotes were somewhat weak. Well, see you all back in 2011.

Hollow Sphere in Blender

12. November, 2007

For a scene in one of my books (a public bath on the TAURUS), I need a ball of water suspended around the center of a large sphere. The sphere outside is the “ground” (you can walk around in it; it’s like the Hollow Earth theory but my version is just the product of careful alien design using magic a.k.a hi-tech to control gravity). I decided to render this in Blender to get a feeling how such a thing might look. What would my character actually see when they step into the bath?

Boolean operators are traditionally a weak spot of Blender (they are a major strength of POV-Ray, if you like text-file driven modeling). I had some trouble to get it to work and if you want to achieve a similar effect, here is how I pulled it off.


First add the inner object (this makes selecting more simple). In my case that would be an Icosphere (Press “Space”, Select “Add” -> “Mesh” -> “Icosphere”) with 3 subdivisions (to make it appear somewhat round even at the edges) and a radius of “4.000”. This should look roughly like this:

Since this is supposed to be the inner volume of the object, there is a problem: Blender thinks it defines the outside. The key information are the “face normals”. Open the mesh tools (Press “F9”) and select “Draw Normals” on the far right (in the “Mesh Tools1” tab; use the middle mouse button to drag the tab into view if you have to – it’s on the far right). Now the sphere sprouts little cyan pimples. Zoom in and rotate the sphere and you’ll see that they start on the center of each face and extend outwards. This is how Blender knows “outside” from “inside”: The direction in which the face normals point is “outside”.

To turn this into the inner volume, all you have to do is to click on “Flip Normals” (“Mesh Tools” Tab, third line, last button). If you have “Solid” rendering active, the face normals will become tiny dots because the triangle faces now hide the rest of them. The object will still look the same but now, you’re “inside” of it. Since all objects in Blender are hollow, it doesn’t mean much … for now.

I want a ball of water and water doesn’t have edges, so I also smooth the surface (“Set Smooth” at the bottom in the “Link and Materials” tab). This doesn’t change the actual geometry; it just draws the object smoothly. In my version of Blender, the object suddenly went all black at this point. Probably because I haven’t assigned a material, yet. Selecting “Solid” rendering helps.

Connecting Hole

I needed a connection between the two sides (there is a “hole” in the hollow water ball where you can swim from one side to the other if you don’t want to dive through it or use the walking spires or elevators in the restaurants), so I cut a hole in the inner sphere by selecting one vertice and deleting it (press “X” and select “Vertices”). In the image, you can see the lighter inside of the sphere shine through the hole:


Before I can create the outside, I must make sure that nothing is selected (or Blender would add the new points to the active object): Enter “Object Mode” (“Tab”) and select nothing (Press “A” until nothing is highlighted anymore).

For the outside, I create another sphere. Make sure the cursor hasn’t moved, so the centers of both objects are the same. If it isn’t, select the sphere, press “Shift+S” (Snap) and then “Cursor -> Selection”. When everything is ready, add the second icosphere: “Space” -> Add -> Mesh -> Icosphere, 3 subdivisions, Size “5.00”. I also make that smooth but I leave the face normals alone (this is the outside after all).

Again, I delete the face where the connecting hole is supposed to be: Select a point (in “Edit Mode”) and press “X” -> “Vertices”. Now, you might face two problems: a) the hole in the inner sphere is somewhere else and b) the hole might be below the one you just cut but it’s not perfectly aligned. If that is the case, you were in the wrong view.

When creating an icosphere (a sphere made of triangles instead of rectangles), the triangles don’t have all the same size. If you rotate the sphere, you can see that they are uneven somewhat. I found that the triangles touching the horizontal axis are very even. The solution: Create the spheres in one view (for example YZ) and cut the holes in another (for example XZ). So after doing everything again and cutting in the right views, it should look like this:

As you can see, I did erase the vertice on the Y axis. Next, shift select both objects (use the outliner if you have problems with the inner sphere) and join the objects (use the menu or “Ctrl+J”).

Smoothing Out the Wrinkles

After joining, it’s simple to close the whole: Switch to “Edit Mode”, select all vertices (six on the inner sphere, six on the outer, sequence doesn’t matter) and “fill” them with faces (in the menu Edit -> Faces -> Fill or Shift+F). If you rotate the scene, you’ll see that new triangles have been created but they look ugly in the otherwise smooth surface of the ball. Even using “Set Smooth” doesn’t help; the angles between the hole and the rest of the surface is just too big (mostly perpendicular). To fix this, use “Subdivide” (“Mesh Tools” tab) and “Smooth” (same tab). This halves the selected faces, creating new ones and the smooth step evens the angles. For me, it now looked like this:

Holy ugly! What’s wrong? I’ve left a hint … can you find it?

It’s the face normals again. For some reason, they point into the wrong direction around the hole. After a few undo steps (press “U”), I’m back at the point where the faces have just been created (before the smooth/subdivide steps). One “Flip Normals” later, the color transitions around the hole look much smoother. Back to another round of subdividing and smoothing. After the hole was as I wanted it, I noticed that the “horizon” of the ball still looked rough, so I selected all vertices, did another subdivide and several smooth to end with this result:

Pretty smooth, eh?

Rendering … With POV-Ray

After fumbling with water that looks at least a bit realistic, I created the same scene with KPovModeler (with water but without the hole *sigh*) to give you an idea what someone, standing on the “ground” would see:

Each piece of the red-white checker pattern on the walking spires is 10x10m, the ball hovers 1250m above the observer, has a diameter of 500m and the water is 50m thick/deep. The two blue cubes are both 100m big, one is standing on the opposite side on the “ground”, the other floats on the water. Anyone wants to add the water-slides, diving platforms (1250m jump!), etc.? With that much water and these dimensions, we’ll probably also have clouds, too. The spires don’t hold the water there, by the way, they are just a means of transport (if you don’t want to jump or use the slides).

%d bloggers like this: