September 28th, 2007
Just before I crawl into bed, here’s a little demo based on the first fifth of Thomas Jakobsen’s Advanced Character Physics. I don’t really have the mathematical background to talk about verlet at any length other than to say it’s very interesting.

The screenshot doesn’t really do the neat “physics” justice – it’s a cheap yet interesting effect.
In a nutshell, velocity verlet is an alternative to Euler (i.e. new_position = current_position + velocity * elapsed). In verlet, velocity is implicitly calculated based on the last position of an entity such that when elapsed is fixed:
new_position = 2 * current_position - last_position + acceleration * elapsed * elapsed
This equation tends to change the way you do pretty much everything related to your game physics. Rather than simply setting your game object’s velocity, you might push it instead via a force or hack the position/last position to achieve the same effect. I’m finding the leap a little daunting myself.
I actually touched on verlet briefly years ago using DirectX thanks to one of my more interesting lecturers at QANTM. Hope you don’t consider the Googling of your name to be excessively creepy, Christian. It’s been a few years.
The supporting code is a little heavy for such a little demo – I plan to put it to wider use, so please excuse the mess for now.
You’ll need a reasonably recent version of Pygame and PyOpenGL installed in order to run this demo. Once it’s up and running, click your mouse on the window to watch some OpenGL triangles drop from the sky. Click, drag and release to fling triangles … almost like you were throwing them yourself.
Hopefully I’ll get a chance to expand on this among the thousand other things I want to do with my free time (not the least of which is writing more Ocaml tutorials)!
Download the Python verlet demo
Categories: Graphics Programming, OpenGL, Python, Software Development |
5 Comments
September 22nd, 2007
Anybody familiar with writing vim scripts will probably be familiar with this syntax:
let foo = 5
Those with slightly more experience may even be familiar with the assignment of local and global variables:
let l:foo = 5
let g:foo = 5
But what you might not know is that you can also assign values directly to registers:
let @a = 5
echo @a
input('Press a key to continue ...')
let @a = 10
echo @a
… and environment variables:
let $JAVA_HOME = "/usr/local/java5"
echo $JAVA_HOME
let $JAVA_HOME = "/usr/local/java6"
echo $JAVA_HOME
Makes for some interesting possibilities in vim scripts!
Categories: Software Development |
2 Comments
September 11th, 2007
Well I’ve been living in Melbourne for about a month and a half now. Just got the Internet and phone connected at long last. Loving the location and the new job (both of which I’m slowly, slowly learning my way around). Hope to get back into some loosely cohesive technical blogging sometime soon!
Anyway: Hello! I’m back!
Categories: Life, Software Development |
3 Comments
September 11th, 2007
Okay, sorry to get all touchy-feely on what’s mostly a technical blog – but here we go.
I’ve just read an article by Jonathan Rauch which was both reassuring and, at the same time, a little offensive. As an introvert myself, I could very much relate to what Jonathan was saying and I think a lot of what he had to say was spot on. However, his assertion that introverts (<em>innies</em>)are somehow more intelligent, reflective and all-round more intellectually and emotionally sound than their extroverted counterparts is a great big pile of blathering crap. I was embarrassed to hear him say as such and apparently truly believe it. So in response to his sweeping generalizations, here are a few of my own:
We’re NOT implicitly more intelligent, we’re just private
Innies think a whole lot. And we keep it all to our quiet little selves. Every single living day, thoughts occur to people – irrespective of whether they’re introverted or extroverted. These thoughts may range from, “What colour shirt will I wear to work today?” all the way through to doozies like, “Why are we here?”. Extroverts are not talking puppets, and most definitely have ideas and thoughts as deep as any introverts. The simple difference is that an extrovert is likely to mention such thoughts in passing as part of a larger conversation. Meanwhile, an introvert may take private joy in contemplating the colour of his/her shirt or the meaning of life all to him/herself.
Extroverts are not necessarily idiots. They’d probably tell you so, too.
We’re not always level-headed
Sometimes people get angry and annoyed. Sometimes they overreact, or get embarrassed, or hurt, or cry. You’ll find this true for all types of personality – wallflower, social butterfly and in-between. Emotionally volatile introverts may give the impression of level-headedness by virtue of the fact they don’t necessarily interact if they’re not “on” in a social sense.
Maybe we’re slightly more independent than the average extrovert (in a very loose sense)
I know as many needy introverts as I do needy extroverts. I’ve seen the extroverted go introverted when in emotional pain, and the introverted tell anybody who’ll listen about their dog dying. I guess the introverted may come off as a little aloof and detached, but it’s not because we care about you any less.
Perhaps one thing that may be true about introverts and extroverts, though, is the innie’s comfort within themselves: to be perfectly happy in silence and solitude.
Does that make us more independent? Too deep for me to think about at this time of night
We’re not more refined (or at least I’m not)
Often my awful Aussie drawl creeps out (I got that from my mother – imagine an Australian version of Fran Drescher). I sometimes struggle to use “proper” English when speaking. I rarely shave (I try, I really do!). On weekends, showers become an optional chore. My shoebox apartment is a fucking mess. No, it’s not because I’m a programmer – I know plenty of refined programmers! – it’s because I’m a bit of a slob. So are lots of people, introverted and extroverted alike. Extroverts are not slobs, wankers or rednecks by default.
More sensitive? Pah!
Rubbish. What about drama queens?
One might argue that introverts are more sensitive because we think about our feelings so god damn hard. The fact is everybody has feelings and we all experience them to varying degrees. How we express these feelings is another matter entirely. To designate introverts as somehow being more susceptible to human emotions shows both ignorance and a little narcissism.
Off-the-cuff tips for understanding an introvert
- Just because we don’t come to dinner doesn’t mean we hate you, nor is it necessarily because we’re lazy. Sometimes we just feel like we need a day to ourselves because we spent yesterday with Bert and last night with Betty. It may surprise you, but this takes a certain amount of effort from us when we’d really like to just sit down and relax for a few hours.
- Chances are your introvert loves to party, but being guilt tripped into going to a party when they’d prefer to be doing something else damages the introverted soul.
- If an introvert says he’ll come to your shindig and then pulls out at the last minute, it’s likely that such a decision wasn’t made lightly. Either something important is keeping him away, or he feels like his presence would be detrimental to the party.
- We love to talk – really, we do – it’s just not always so easy for us to know what to say. (Disclaimer: Other innies may feel differently!)
- Sometimes we just like time to be with ourselves and our own thoughts. Nothing personal.
Please don’t get the wrong impression of us innies from Jonathan’s article. He almost hit the nail on the head, but instead just wound up stomping mercilessly on the toes of pretty much every extrovert who might happen upon his somewhat harsh article.
Categories: Life |
No Comments