the next thing in computer graphics?

December 8th, 2006

Alright so we have things now in graphics that some *raises hand* never thought would be realized. If you play the latest FIFA Soccer, you'll see some pretty accurate detail in the graphics. Players' bodies, facial characteristics, hairstyles, even their signature moves. In fact, if you just look at action shots from the game, you might think it's a pretty damn good reproduction of reality. But one thing that isn't quite right is how these characters move. That's because these models are just a bunch of dots in space, fitted with curves I guess and this makes up a very accurate model of their contours. Then the shapes are covered with mesh, that is bitmaps of some kind, which makes them look like 3D objects with surfaces, rather than just dots. Imagine fitting a towel tightly over a ball, covering it's surface completely. But they are hollow characters, their mass is completely unaccounted for. So when you render still images, they look striking, but when you try to animate these models, you're facing a whole new set of problems.

You couldn't build a real human being with just a shell, so in graphics you can take that shortcut. But when you move limbs around to simulate real human motion, it's not very clear exactly how to do this. What EA Games does is bring in some of these players they want to model, fit them with a large number of sensors all over their bodies, and tell them to move around just like they do when they're playing matches. So let's say you have a sensor at the knee and one at the shin. Now you can register the movement in all three dimensions of these two body parts relative to each other. And with enough points on the body, you get some kind of 4D model of human motion. What you can do now is plot these points where the sensors are on the human body to points on the computer model. You have to define joints to determine which parts move, but after that you can pretty much reproduce the same move that the human does with the computer model of the human. Pretty neat, huh?

If you think that's a big step forward, well there are still lots of problems to solve. A common problem in all kinds of games is collision handling. When two players run into each other, what happens? If you do nothing to handle this, they will just run through each other as if the other player was never there. Collision handling in football simulation games that I've played is still very primitive. Motion of the ball bouncing off the body is very unrealistic and hasn't improved much in years. Player collisions in the form of tackles are also very mechanical. The aspect of interacting bodies adds complexity to the problem, so let's go back to the single body in motion.

There is still a great deal missing in how just the one player moves. The moves don't look real. Even when they are modeled directly after human motion as described, their complexity is still too shallow to look real. I remember playing one of these FIFA Soccer games a few years ago and they chose Edgar Davids as one of their main profiles for that edition. Davids, of course, very characteristic for his dreads, which they modeled pretty damn well in the game. But guess what, even when his head moved, the hair didn't, it was as if he had overdosed on a whole can of industrial strength wax. The hair was completely fixed and moved along with the head, but it wasn't affected by gravity or anything like that. Hair is complex enough to illustrate this point very poignantly.

It comes back to what I said already, the human body is hollow, it has no mass. The surface is rigid, which means that when a player receives a ball on his thigh, the surface of his skin doesn't indent under the momentum of the ball, as it should. Mass responds to forces of nature - a hollow shell couldn't possibly. We are doing quite well with surfaces already, will the next step be to model mass? Just imagine what kind of human motion you could get if you modeled mass as well... hair flowing, muscles moving, ball motion that looks real as the foot connects with the ball and sends it away.. This is how I imagine it's going to work. You divide the mass into parts. Then you assign to each part a certain weight and typical characteristics of this portion of mass, that is how dense it is, how hard it is, and so on. Then you apply functions to these parts and determine their motion on say a grid of points. Much like the way you simulate synthetic materials with finite element analysis. The difference is that these are body parts, not distinct from each other, like the mechanical parts of a car. Then, for the purpose of a game, you have to combine the curvatures of the mass with the surface somehow, so that when muscles are contracted, the shape changes. For this to be accurate, you would probably plot much denser points at the surface of the mass than inside of it when simulating its motion.

What remains is still to define the direction of these forces. A mass modeled this way will respond as an inert body, but what is it that is exerting a force on it from a certain direction? This is the result of muscle motion, which again would have to be modeled somehow in order to get a self-contained solution. But if we leave that aside for a moment and go back to registering human motion with sensors like EA Games do, you would have a pretty complete model of human motion at this point. Just imagine what you could do with this, pretty neat things that haven't been possible so far. It's pretty hard to capture on film how a player shoots the ball, to capture the full complexity of the foot's motion when this occurs within fractions of a second. But if you could register this motion with sensors in a very detailed way, you could then recreate the motion, and add mass models to show how the mass would respond to this motion. In doing that you could make a video of how the foot moves just as it strikes the ball, zoom in on the foot very detailed and observe the actual muscles, the toes, everything. Now that would be some amazing detail.

Is this where we are headed?

Tomorrow Lives

December 5th, 2006

If you haven't seen the James Bond movie from 1997 called Tomorrow Never Dies, you should. One because it's a cool movie with an interesting plot and a competent execution of that plot, two because the soundtrack by David Arnold is a work of art. Definitely one of the better Bond movies to be made in the period since Brosnan made the role his.

But back to that plot. The villain is Elliot Carver, a media mogul with evil plans to manipulate his global media empire for his selfish goals of economic success. Think about that idea for a minute. Does that sound far fetched? It doesn't really, does it? Lawrence Lessig writes in his book Free Culture:

Five companies control 85 percent of our media sources. The five recording labels of Universal Music Group, BMG, Sony Music Entertainment, Warner Music Group, and EMI control 84.8 percent of the U. S. music market. The five largest cable companies pipe programming to 74 percent of the cable subscribers nationwide.

So it's not one Carver empire, it's five different corporations in competition with each other.

Another thing that has changed is that up until 2003 the media could not own the content they published, because the law forbade it. Now they do own it, so you can get a full, integrated package from a single outlet.

Murdoch's companies now constitute a production system unmatched in its integration. They supply content - Fox movies, Fox TV shows, Fox-controlled sports broadcasts, plus newspapers and books. They sell the content to the public and to advertisers - in newspapers, on the broadcast network, on the cable channels. And they operate the physical distribution system through which the content reaches the customers. Murdoch's satellite systems now distribute News Corp. content in Europe and Asia; if Murdoch becomes DirecTV's largest single owner, that system will serve the same function in the United States.

It's funny when you realize that what you saw in a fiction movie is the actual reality. Is Rupert Murdoch today's Elliot Carver?

murdoch_carver.jpg

who's reading?

December 4th, 2006

I haven't been doing much reading lately, it's been forgotten and neglected. But I'm hoping to revive it, so here's a list of books since last time.

Stephen Hawking :: A brief history of time

I had a habit of buying books as gifts, especially for Christmas. I bought this one as a gift without having read it, simply because it looked good to me. As it turned out, I was given the warmest recommendation to read it myself, after it had been most well received.

Hawking does only one thing in this book. He explains the "history" of the universe. As we have believed it to be from ancient times right up to the present. Along the way, he tackles all these theories in a simple and understandable manner, perfectly suited for the layman.

Lawrence Lessig :: Free Culture (online)

It may seem puzzling that anyone would pick up a book that deals chiefly in law, the history of copyright law, the different events that shaped the law and so on. But Lessig's book is a valuable text for the sake of understanding what copyright law is all about and what fairness in copyright means.

It is in many ways a sickening account of the monopoly of the rich, as with so many things. Historically, and presently, copyright owners (that is publishers, not writers) have strived to monopolize the rights for works they own and to keep this right forever. This applies not just to books, but to all other forms of creative content. It is amazing how authors don't own their own books, musicians don't own their own recordings and cartoonists don't own their own cartoons. It's a bit of a paradox that copyright, which is supposed to protect creators, actually only protects big companies which own these rights for profit.

Lessig's point is that culture is becoming increasingly restricted. While it was possible for Walt Disney to base his cartoons on existing cartoons, it wouldn't have been possible today. These restrictions stifle creativity and go against our society's traditions for culture. This discussion is in many ways an equivalent of what free software is to software.

The book is all the more interesting, as Lessig talks about the case heard before the Supreme Court in 2002, that he argued about Congress's power to extend copyright on existing works indefinitely (which in his view is unconstitutional). Lessig describes the case in some detail and offers analysis on why the case was lost.

George Bernard Shaw :: Pygmalion (online)

An old [comedic?] play describing how a Cockney girl is transformed into a lady by a professor of phonetics who teaches her to speak correctly. The story is not exactly profound and as most plays are, highly predictable.

H. G. Wells :: The Invisible Man (online)

An early science fiction story of a man who discovers the secret of invisibility. I stumbled upon it by chance, and quite liked the build-up in the story. Incidentally this is the same author who wrote the mother of all alien invasion stories - The War of the Worlds.

Karl Marx & Friedrich Engels :: The Communist Manifesto (online)

The manifesto is quite interesting to read, although there are things that are difficult to understand (remembering that it was conceived in 1848, in those circumstances and realities). It gives strong references to historical movements and revolutions, and cites communism as a natural follower of those. It also deeply criticizes the entire social and political system, and explains how communism provides a natural and effective solution to cure the ailments of the society at large, not just the interests of the working class.

One of history's juiciest ironies. Here's a school of thought which criticized the position of the working man in present society, as an individual of no rights, no power and no influence, subjected to terrible working and living conditions for the unending pursuit of profit for his superior, and which strived to improve upon this and reinstate the worker as a individual with rights and personal values. Then, in practice, it is given as a pretext for a revolution, a shift of power, a popular uprising. This new found power, in turn, is used to oppress the common man to the same set of living conditions, lack of influence and spiced up with some additional ideological values to constrict freedom of expression. I'm tempted to say that noble values are the most dangerous weapon for any intellectual to possess, by which to dupe the gullible masses, only to exploit them instead.

Franz Kafka :: The Metamorphosis (wikipedia)

Under its original title called Die Verwandlung (ie. The transformation), which makes me think the English title is appropriate, but somewhat exaggerated as to the original one. It's a one-of-a-kind sort of story. A seemingly normal man wakes up one morning having been transformed into some kind of animal or insect. He has the consciousness of a human, but to outward appearances he is anything but. At a first glance, this sounds like a trivial children's tale, but what makes it interesting is the thoughts that go through his head. I'm sure few people are thinking "if I woke up one day as an animal, what would I be thinking?", but the story answers these sorts of questions. Kafka describes everything that happens in great detail, every thought, every physical movement, every noise. Gradually, his mind begins to transition into a state where he becomes more consistent with the animal than the human. What is most puzzling about this story is how his family treats him. It begs the question - why do they think this bug is their son to begin with?

While it escapes me just how this story is so incredibly important, it has an exhaustive list of derived works and references from other works, so it's "one to know".

Colin White & Laurie Boucke :: The UnDutchables

For all intents and purposes, an 'introduction' to the Netherlands. It is written as a comedic description of the many odd habits and customs in this country, and it's quite informative. Of course, it's easier to inform than to make you laugh and the comedy falls a little short here. It's the book you want to read if you plan to be here for a few months.

Ben Long :: Complete Digital Photography (online resource)

If you need a reference to digital photography, this is a very good choice. Unlike some books, it gives a very complete treatment of the subject, beginning with the optical theory behind a digital camera (some books treat this very superficially), through explaining what kind of camera to choose and why, through all stages of photography, and concluding with a lot of photo manipulation techniques on pictures already taken. So if you feel deficient in any or all of those aspects, you're getting a great run down. The author does not base the instruction on any particular kind of equipment or software, so you can follow along with whatever you have.

Fyodor Dostoevsky :: Crime and punishment (wikipedia)

Truly one of the best books I've ever read. The psychological drama of Raskolnikov is described with such pin point precision and realism, that it deeply grips you. It's been quite a while since I read it, so I don't remember very much of it anymore, but it's more than a story, it's an experience really. The story is such an accurate crafted account that you don't feel like you're missing anything at all, everything you want is contained. Some books keep you wondering about what happened after the story or about some detail that wasn't explained properly, but not here, it's all there.

Of course, the central theme, to commit a crime and accept punishment for it, is a very simple idea, but explored in all its intricacies. Aside from the setting, the characters who interact with Raskolnikov, the city, the atmosphere and everything external to his tragedy, what really is of great value is everything he goes through. Those auxiliary elements are necessary, but in a sense, irrelevant. As such, the narration drifts away from Raskolnikov's plight at times, which is where it loses its appeal. But all in all, a very well done story indeed.

random posts from category

December 3rd, 2006

The other day I was thinking it would be nice to have a little space below every blog entry that displays past entries from this same category, but in random. So this would be a cool way to explore old entries for someone who hasn't seen the blog before, but no less for me since I wrote that stuff at one point and forgot all about it. It was actually seeing KeyBi's blog that inspired me to do this, cause he has a random posts feature on his.

I used an existing plugin and modified it for my needs to look exactly as you can see at the bottom of this post.

So now it's easier to browse old posts, but this brought out an old problem, namely that entries posted before the migration to WordPress were not input with their comments counted, so although these old entries have comments, WordPress doesn't seem aware of this. I fixed that with the simple script below.

<?

$user = '';
$pass = '';
$db = '';
$host = '';

$link = mysql_connect($host, $user, $pass) or die("kernel panic");
mysql_select_db($db);

$sql = "select ID from wp_posts where post_status = 'publish'";
$result = mysql_query($sql);

$IDs = array();
while ($row = mysql_fetch_row($result)) {
	$IDs[] = $row[0];
}

foreach ($IDs as $i) {
	$sql  = "update wp_posts set comment_count = ";
	$sql .= "(select count(*) from wp_comments where comment_post_ID = $i ";
	$sql .= "and comment_approved = '1') ";
	$sql .= "where ID = $i";
	mysql_query($sql);
}

mysql_close($link);

echo "Comments updated.";
?>

the summer cyclist

December 2nd, 2006

In the summer of 2003 I was in Stockholm on vacation and at one point I found myself at a TGI Fridays. You can spot the place like two blocks away for their ugly decor. Anyway, the place was pretty busy, and noisy. I was staring in the menu at a long list of names, none of which looked familiar to me. Finally I turned it over and there was their smoothie menu. Ah, something more to my pallet. I can usually tell when I've made a good choice and I was pretty confident about the Summer Cyclist. It turns out I wasn't mistaken, it was awesome. The drink has become somewhat of a legend to me, but today it occurred to me to google it and I found a recipe. :party:

Summer Cyclist Smoothie

Ingredients:

  • 55g Pureed Strawberries
  • 50g Grapefruit Juice
  • 30g Pineapple Juice
  • 1 scoop Orange Sherbert
  • 1/2 cup Crushed Ice

Directions: Use a blender

Granted I've no idea where to find this sherbert stuff, but I'm one step closer to reproducing this drink. :D