🔒 Locked
math and game coding
Advertisement
Original Post
My math is not very good, just did it in high school and all the books I get on computer graphics are covered with math formula. I do hold a degree in computer science and feel very proficient with C++, but everytime I come to sit down and try do work on a game I struggle with the math. I can easily put a cube on the screen, move it about etc.,.but struggle to understand the like of transformations, rotations etc..
Should I give up now?! Surely not all game programmers are experts in maths too ?
Thanks
When I first started programming about 16 years ago, the world of games was very much "2D" - proper 3D was reserved for military and scientific things. Because of that I didn't really have much of an interest in maths when I was at school because I couldn't see much practical application to what I wanted to do (code games etc).
Since then the world has changed a lot. I've had to teach myself much of the stuff I missed and higher. I'm still not up to maths degree level, but have been working commercially in games in some way or other for about 10 years, most recently writing 3D engines. [I got a C at GCSE due to lack of interest!
]
Basic 3D maths will pop up all over games programming and the more you know the easier you'll find stuff, but it really depends which area of games programming you want to specialise in. An AI programmer for example would need some basic vector maths for pathfinding etc but not too much more.
One thing you'll find with maths and graphics books is you can't skim read them if you don't want to get lost, that was one of my mistakes. Each formula usually builds on a previously explained formula. Where a formula starts to get too large it gets condensed down to shorthand. If there's a variable you haven't seen before, then it was probably the result of a previously explained equation. The Greek letter which looks a bit like an E is really just a 'for' loop. It does take time to get what's going on, but stuff does start to 'click' if you keep at it.
A book I'd recommend is "Realtime Rendering" by Moller & Haines - it's appendices and maths chapters are excellent for this stuff (the rest of the book is great too!).
As for transformations and matrices etc, start with vectors!. Learn about vector spaces, operations with vectors and in particular what the results of those operations "look" like (draw them on paper). Learning the dot product and cross product linked vectors to the very basic stuff I'd learnt in school trig (pythagoras, sine, cosine, triangles etc) - that was one of the important "click" things for me.
The next "click" was the realisation that a matrix can be thought of as a set of vectors (see how it follows on - one concept builds on top of another). When you start to draw those vectors on paper and realise which way they point, and what happens when they're at right angles to each other and what happens when they're not you'll start to understand what rotation, scaling, shearing etc of matrices is really doing.
Don't give up - enough maths to do most things in games programming CAN be learnt with some patience and perseverence.
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Edited by - s1ca on December 23, 2001 7:06:44 PM
Since then the world has changed a lot. I've had to teach myself much of the stuff I missed and higher. I'm still not up to maths degree level, but have been working commercially in games in some way or other for about 10 years, most recently writing 3D engines. [I got a C at GCSE due to lack of interest!
Basic 3D maths will pop up all over games programming and the more you know the easier you'll find stuff, but it really depends which area of games programming you want to specialise in. An AI programmer for example would need some basic vector maths for pathfinding etc but not too much more.
One thing you'll find with maths and graphics books is you can't skim read them if you don't want to get lost, that was one of my mistakes. Each formula usually builds on a previously explained formula. Where a formula starts to get too large it gets condensed down to shorthand. If there's a variable you haven't seen before, then it was probably the result of a previously explained equation. The Greek letter which looks a bit like an E is really just a 'for' loop. It does take time to get what's going on, but stuff does start to 'click' if you keep at it.
A book I'd recommend is "Realtime Rendering" by Moller & Haines - it's appendices and maths chapters are excellent for this stuff (the rest of the book is great too!).
As for transformations and matrices etc, start with vectors!. Learn about vector spaces, operations with vectors and in particular what the results of those operations "look" like (draw them on paper). Learning the dot product and cross product linked vectors to the very basic stuff I'd learnt in school trig (pythagoras, sine, cosine, triangles etc) - that was one of the important "click" things for me.
The next "click" was the realisation that a matrix can be thought of as a set of vectors (see how it follows on - one concept builds on top of another). When you start to draw those vectors on paper and realise which way they point, and what happens when they're at right angles to each other and what happens when they're not you'll start to understand what rotation, scaling, shearing etc of matrices is really doing.
Don't give up - enough maths to do most things in games programming CAN be learnt with some patience and perseverence.
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Edited by - s1ca on December 23, 2001 7:06:44 PM
Thanks Simon,
I think you''ve hit the nail on the head with the ''skimming'' over stuff, I seem to do this a lot and hence get lost in the text.
The book you recommend I have seen at a friends house the other day - he''s a game programming working for Warthog, as soon as I looked through it, I thought it was pleasantly clearly written and have it on order through amazon (1 to 2 week waiting on it).
I do have many 3d graphic books but all are obviously very mathematical.
I too like you just studied upto O-level math and really wished I''d gone higher with it. I''ve started learning math again from a really good book I bought (A math survival guide) which covers most topics found in 3d (matrices, trig, linear algebra) and this is starting to help, but being a s/w engineer as a full-time job it''s difficult to fit the time in.
Many thanks Simon for your comments and advice, I sure
do feel a lot more inspirational.
Kind regards,
Steve
I think you''ve hit the nail on the head with the ''skimming'' over stuff, I seem to do this a lot and hence get lost in the text.
The book you recommend I have seen at a friends house the other day - he''s a game programming working for Warthog, as soon as I looked through it, I thought it was pleasantly clearly written and have it on order through amazon (1 to 2 week waiting on it).
I do have many 3d graphic books but all are obviously very mathematical.
I too like you just studied upto O-level math and really wished I''d gone higher with it. I''ve started learning math again from a really good book I bought (A math survival guide) which covers most topics found in 3d (matrices, trig, linear algebra) and this is starting to help, but being a s/w engineer as a full-time job it''s difficult to fit the time in.
Many thanks Simon for your comments and advice, I sure
do feel a lot more inspirational.
Kind regards,
Steve
quote:
he''s a game programming working for Warthog
What''s his name ?.
Strange coincidence that - the company I work for (Creative Asylum Limited) rents office space from Warthog in the Eden Place building in Cheadle. We know them *very* well (they formed about 6 months before we did). We''ve worked on a couple of things with them - we also share some contacts, knowhow etc.
--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
I don''t personally know him, but I''d very likely recognise him if I saw him (I know what all of the ex-Infogrames lot look like - all the people from that floor currently have to come through our office while the new Warthog stairs are (re)installed). I do know some of the other recent ex-Infogrames lot though - Malcolm & Martin, and some of the older ones too Wiz, Flange etc.
--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
To me, programming IS math.
Programming is just another way of solving a problem.
Just like a math student, a strong programmer is strong in terms of problem solving and knowing how to use what he has, just like a strong math student.
In terms of problem solving, I'd say Im pretty good, but there are others who are much better than I at my school(Woburn CI), which generally finishes quite high in ACSL (american computer science league). However, I've gotten better and better by simply learning from my gifted colleagues
Edited by - RelisH on December 24, 2001 3:16:19 PM
Programming is just another way of solving a problem.
Just like a math student, a strong programmer is strong in terms of problem solving and knowing how to use what he has, just like a strong math student.
In terms of problem solving, I'd say Im pretty good, but there are others who are much better than I at my school(Woburn CI), which generally finishes quite high in ACSL (american computer science league). However, I've gotten better and better by simply learning from my gifted colleagues
Edited by - RelisH on December 24, 2001 3:16:19 PM
RelisH:
I mostly agree with that. But for those of us who havent been through complete academic maths training, we miss some of the "tools" to solve those problems and knowledge of the notation in use - it''s that we have to learn, and that which makes some maths "look" confusing. I suppose it''s akin to someone with a degree in maths who sees a C++ program for the first time. Now I know what vector spaces are, what matrices are and many of the operations on them, they''re extra "tools" I can use to solve problems.
steg:
I think I know who you mean, smoker, often wears a denim shirt.
--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
I mostly agree with that. But for those of us who havent been through complete academic maths training, we miss some of the "tools" to solve those problems and knowledge of the notation in use - it''s that we have to learn, and that which makes some maths "look" confusing. I suppose it''s akin to someone with a degree in maths who sees a C++ program for the first time. Now I know what vector spaces are, what matrices are and many of the operations on them, they''re extra "tools" I can use to solve problems.
steg:
I think I know who you mean, smoker, often wears a denim shirt.
--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement