Showing posts with label computer graphics. Show all posts
Showing posts with label computer graphics. Show all posts

2018-05-05

I maded a film

Reading Devaney’s An Introduction to Chaotic Dynamical Systems, Second Edition I found the description of a solenoid (§2.5) quite interesting: It starts out as a torus, but then you repeatedly lengthen it, shrinking the radius, and fold it back on itself, much like you fold a hair tie, but with the difference that the volume is not retained, so that each folded form fits inside the previous one. I thought that it would be nice to make a recursive function to draw a solenoid to arbitrary depth, and then to make a raytraced animation of the solenoid developing. As it were, I couldn’t quite work out the proper recursive step, so the idea has been languishing for a while (like a couple of years or so).

A few weeks ago I decided that I would get a grip on myself and work out the proper function, since it was obviously simple, if nothing else so to make sure I’m not entirely senile. After a couple of nights of scratching sketches on paper I finally managed to work out the proper order of things and started to transfer data to POVRay, my preferred raytracer. And of course, since I fully subscribe to the idea that glass balls are an important feature of raytracing, I would make the solenoid out of virtual glass. It would also spin, so as to bring out the shape better (on the assumption that viewers would not have access to a stereo viewer).

I soon realised that it was inconvenient to run a C program to generate the coordinates of the object and transfer to a POVRay input file by cut-and-paste every time I wanted to tinker with anything. Happily it is possible to program directly in the POVRay scene description language, so I reimplemented the function and could then work more or less interactively in POVRay. Delaney proposes shrinking the radius of the tube by a factor 10 for each folding, but in my opinion that makes it disappear from view too fast, so I used a factor 3 instead.

My original idea was that I’d render each level and fade it out while fading in the next level, but it turned out to be rather complicated as the surface+interior computational model of POVRay doesn’t really have a concept of fading, to achieve this a large number of (non-linear) parameters have to be adjusted in synchrony. I pondered this a bit, but decided that while I might eventually work out how to do the transforms it was probably easier to instead do the fading on the resulting images, rather than the 3D models, so generated images with only a single object in each and then composited them using ImageMagick and a couple of awk scripts.

This looked OK, but I still wasn’t quite happy with the results, there should be more movement in the animation. In the end I rewrote the solenoid code a bit, so that there would be an animated transition where the next level double-coil shrinks and separates out of the previous level. On a whim I added a background texture and was happily surprised by how much this made the glassiness of the tube pop out and made its structure more distinctive. The full length video took almost a week to render, the later parts requiring about an hour per frame, as the object becomes more complex. For no particular reason I rendered the animation at PAL resolution, notionally at 25 frames/second, but that made the motion a bit too fast in my opinion, so I pulled the output framerate down to 10 fps when generating the video (with ffmpeg) from the individual frames rendered by POVRay. That could then be uploaded to YouTube:

If anyone wants the code to play around with, just ask in the comments.

2016-09-01

Beautiful betrayals

When the Iron Curtain fell, there were great hopes and expectations on both sides and one of the buzz phrases of the day was “joint venture”, so at the computer graphics conference I attended in St Petersburg in 1993, there was a hall dedicated to various proposed joint ventures between Russian and Western companies, hopeful Western computer manufacturers showing off their latest hardware to Russian customers who couldn't afford to buy any of it. The hall was, as such things are wont to be, pretty noisy, but suddenly something like a sonic blowtorch cut through the noise and on one of the screens I saw things you people wouldn’t believe, but then it ended and I realised I had just caught the last few seconds of a computer animation with music, but of what, I did not know.

A couple of years later I attended a computer graphics seminar at a conference hotel in Linköping. The speaker was fast-forwarding through a VHS tape and I glimpsed this same animation, but it was not part of the presentation. However, I asked for, and received!, permission to return to the room and go through the tapes on my own after dinner.

So, there I sat, late at night in a dark conference room in Linköping, watching and listening to the L’Opéra imaginaire version of « Dôme épais le jasmin » from Lakmé, tears streaming down my face.

As soon as I could I bought the full opera recording with Sutherland, Vanzo, Bacquier, and Berbié, conducted by Bonynge. I immediately brought it to the lab to share all this beauty with my coworkers. They were mostly amused by my excitement, but one person, composer of electro-acoustic music, rushed out of his room, screaming: “Of all the noise you make here, this was the worst!” and slammed the lab door closed, so as to keep the rest of the institute secure from the noise pollution.

I myself was pleased to find that apart from the Flower Duet there were several other songs that lingered in my ears. I was however a bit put off by the orchestra crescendo at the death of Lakmé, I felt a solemn fadeout would have been more respectful.

I noted that the plot, with a Western officer seducing and then abandoning an Asian woman, was quite similar to that of Madama Butterfly. Only much later did I find out that both operas may have been based on stories by Pierre Loti—the English Wikipedia entry for Madama Butterfly asserts that it is based on his novel Madame Chrysanthème, whereas the French entry denies this. (The Italian does not mention Loti at all.)

2010-08-28

How do they do it?

We went and saw Toy Story 3 and much to our surprise we found that it was a threequel that had lost none of the ability to spin a new story on the old theme. I don’t remember the last time I saw a film where I was so genuinely fearful for the characters when they were in the ultimate pickle. Of course I’m also terribly sentimental and had to blink quite a lot on several occasions; hardnosed Honeybuns enjoyed the jokes and didn’t register the theme of loss of childhood at all, so from quite different perspectives we still thought it was a great film. I got a flashback to Tin Toy, where apparently some of the elements of the story were already present.

Of course Toy Story is in 3D, as is required of all new film these days, but that doesn’t make much of a difference for the film. In contrast, the introductory short: Night & Day makes brilliant and innovative use of 3D—by combining it with 2D graphics.

2010-02-27

Avatar

We have now seen Avatar. I can but agree with former reviews, the story is utterly trite (the protagonist starts with smaller challenges and keeps practicing until he’s ready to meet the Level 20 Boss) but computer generated actors have definitely come of age. I was shaking all over when the film ended.

Some random things that came to mind:
  • Jacking into the avatar is visualised with a fly-through of a winding tunnel of lights. This was clearly the effect they spent the least effort on, did they use someone’s screensaver for that?
  • But for the rest: The textures, the textures! And the shaders! Amazing levels of detail!
  • A veteran marine comes up with the brilliant idea of a cavalry charge against heavy machine guns? They should have brought in some Ewoks to give them tactics training.
  • Or logistics. If you are bringing together several thousand warriors with their steeds into a small area, how are you handling the supplies issue? What did the latrine trenches look like?
  • While noble, the Na‘vi were savages, so of course they have to hunch over and lean forward to gingerly touch anything exceptional. And bare their teeth and hiss in anger.
  • So while they live in harmony with Life, the Universe and Everything, they still have a (male) warrior class. (Chief’s Daughters are always tomboys, so they get to fly and fight too.)
  • Sacred music sounds Western European all over the universe.
  • Did anyone else feel the Hometree was reminiscent of The Holt in ElfQuest? (And of Lothlórien, and of Endor, and of Athshe. Hmm, a trope, it seems.)
  • Jake Sully’s wasted legs were very convincing, were they also computer-generated?
  • Michelle Rodriguez is hot.
  • I was devastated to find that Sigourney Weaver smokes.
  • No longer can a standard single column be used for credits, the full screen width has to be used to fit in all the names.

2010-02-07

3D!

We’ve had a very cultural Sunday. We started by seeing the current exhibition at Galleri Hagström and commissioning some paintings. (It sounds very grand, eh? In other words we asked our friend Pia to paint some more goldfish just for us.)

We continued to the recently re-opened Museum of Medieval Stockholm, where we spent a couple of hours. It felt as if it perhaps was not quite finished yet, as there was a large number of display cases with various objects without any explanation whatsoever of what they were or where they had been found. On the other hand, the exhibits showing how archaeologists work in combining various scraps of information into a story were very well thought out. On one wall was displayed a large computer animation of the Old Town, as seen from the north, some time in the late Middle Ages, but I thought it was rather cheaply made and could have been much more impressive with just a bit more effort put into textures and bump mapping, so that the buildings wouldn’t look quite as cardboardy.

We strolled off for dinner at Pong buffé, which was much satisfactory—buffet tends to be a sloppy story, but they managed to keep the food looking fresh and appetizing and it also was very good, even though somewhat lacking in the vegetarian area, we will probably go for the à la carte next time.

After dinner, obviously a film. We went for the 3D version of Cloudy with a chance of meatballs. It turned out to be much impressive, suddenly circularly polarised stereographic goggles are cheap enough to hand out to cinema goers, as well as good quality enough that there is no visible ghosting in the images. In addition to this, the film was perfectly enjoyable and would have been so even without the 3D. And of course, it extolled the importance of nerds. The end credits felt at some remote inspired by Yellow Submarine.

2009-12-25

Quest: A Long Ray's Journey into Light

There's nothing quite like ray tracing of glass spheres to scream out “Computer Graphics!” Unfortunately the YouTube version of this classic is rather fuzzy.



I did work on an Apollo one summer at Ericsson. I thoought it a bit weird at points, but it had a Logo implementation, so I played around with turtle graphics; a fairly natural way of doing graphics for me anyway as I at the time mostly worked on a pen plotter—graphics displays being very expensive and hard to come by.

2009-12-15

Beyond the '80s

Fractals were all the rage when I was an undergrad, and I have the T-shirt to prove it, but they've not been front page news for a long time. Maybe they should be:

Mandelbrot set in 'Buddhabrot' rendering

2009-11-30

OK, it's an ad

…but it's still a seriously weird example of what you can do with digital post-processing.