More mesh and matrix antics.

Klein bottles are fascinating. In this case it’s in 3D and intersecting itself? I was looking around to see if there was some sort of 4D visualisation of the structure and found this:

Klein Bottles are really cool. I once saw a guy on TED who actually made some kleinbottles out of real glass…
Watching the video from @Simeon turned my brain inside out however…

The one in my video is technically known as an immersion. It’s allowed to self-intersect but not “fold up” on itself. There’s no way to get a true embedding in 3-space but it can be embedded in 4-space.

I wonder if Codea is fast enough to do an animation of it forming. My program is quite flexible: it constructs a tube around a path of varying radius and the path and radius functions can be anything one wants so it would be possible to animate a cylinder into the bottle.

I’m not convinced I like the representation in that video. It took me longer than it ought to have done to understand what I was seeing. The self-intersection goes across the torus and it’s hard to see, I think.

New video

This is the devil’s work. No good will come of it!

Hello Andrew. Nice. Can you make the bottle half transparent?

@Jmv38 If you look at the first video you’ll see that it is translucent. The problem with making it not fully opaque is that you run into the z-buffering issue. OpenGL doesn’t take into account alpha when working out whether or not to paint a particular pixel using a particular triangle. If it is below what is already there, it doesn’t paint it, even if what is already there is fully transparent. You can see the effect of this in the first video if you know what to look for - it’s hard to describe but there are two colours in evidence depending on whether the back face was drawn or not.

The “growth” video was done by setting colours to a particular alpha (and then reversing it). I can vary the alpha values there as well. But again one runs into the z-buffering issue which is why it runs in the direction it does: running it in the other direction then you get really strange effects when viewing from an angle where a piece that hasn’t been coloured yet occludes a piece that has.

I now have another way of doing the growth which involves actually moving the vertices. This works much better. As I’m only working on 144 vertices each frame then I still get a frame rate of 45fps or better even though there are nearly 70,000 vertices in total.

.@Andrew_Stacey thanks for the answer. I hadn’t noticed the first video. Concerning those stange objects with unusual properties: For the moebius roll i heve no problem to admit it has 1 edge only and one side only, it is just perfect. But for the Klein bottle, ok it has 1 side only and no inside/outside, but this junction between the neck and the body is not very nice: it is not quite as perfect as the moebius roll… And it is much more difficult to clean the inside (or outside…) of the bottle in the dish-washer …