Trivial mathematics

Published July 10, 2004
Advertisement
I started a basic demo of steering behaviours using C++/SDL the other day, which are great for getting amazing looking results with very little code. It quickly reminded me of how rusty my trigonometry was though! For example, it took me 10 minutes of scribbling on the back of an envelope before I could prove to myself how to calculate the angle of a vector (hint). Sad. However, I find that proving an answer to yourself is always more satisfying than looking it up, because you come away with not only an answer but an understanding of the process.

My next task is to implement a wandering steering behaviour by randomly displacing a point along the circumference of a circle located in front of the vehicle. It sounds trivial but all the converting to and from angles and vectors and translating from absolute to relative values starts to send me mad after a few hours! This is why I don't tend to bother with 3D graphics...
0 likes 2 comments

Comments

Kylotan
To be honest I don't do much that is mathematically based! I play to my strengths and avoid my weaknesses, so to speak. Thanks though.

Most of the interesting aspects of steering behaviours can be found at the web site I linked to, including Java applets demonstrating how they work. My project just combines that with the concept of staying in some basic formations, which has been well-covered by a couple of articles and papers, but which I thought I'd attempt myself.
July 18, 2004 07:12 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Advertisement