Advertisement

Book : Physics for game developers

Started by November 10, 2002 07:56 PM
1 comment, last by ironballs 22 years, 3 months ago
Guys, I bought the above book a week ago, and although it is very good at providing background knowledge of physics (most of the stuff I new already), one major thing struck me as I read it. Now I guess this must be an obvious statement, so don''t kill me for it. The books author, all the way through the book uses trig to work out angles etc, for example in firing a projectile, he uses trig to separate the forces in horizontal and vertical components. But in designing my own simple physics engine, I thought, why use expensive trig. functions, when vector maths will sort it out for you. e.g. a Velocity vector of v = (0,0,0), if there is an acceleration vector of a = (0,20,10), and we have a time interval of t=1 second, and gravity is g = (0,-10,0) N, then to work out the new velocity vector, we simply do: v_new = v_old +(a+g)*t v_new => (0,0,0) + (0,10,10)*1 > => (0,10,10) Is that obvious, and have I just stated the most obvious thing on this forum, but why even think about using trig and the equations of motion etc? cheers Matt
I haven''t read the book, but I''m assuming the author started with an angle and a acceleration instead of starting with (0, 20, 10).

If you start with vectors, then your way makes sense. If you start with "the turret is angled at D degrees and the muzzle velocity is V", then you really need trig.

Like I said, I haven''t read the book, but it''s probably easier to explain the concepts using trig. If you can create your engine in a way that doesn''t use trig, that''s great, but you will probably have to jump through hoops that aren''t necessarily a key part of learning physics.

Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces"
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
Advertisement
I think that the issue that you are running in to is the difference between the math, what is programatically ideal, and how we think about real world situations. In mathematical terms, either way is perfectly acceptable. Because of the various ways to represent vectors (magnitude-angle, components, imaginary numbers, etc.), it is important to be versed in all the different methods of dealing with them. I personally like component form, but sometimes its nice to know what the magnitude is rather than looking at the direction. Programatically, it would be best to have everything in terms of components because then vector arithmitic simplifies to addition problems. Finally is the issue of how we think about vectors. When driving or flying, we use bearings and magnitudes because it is far easier to understand flying 300 m/s at 65 degrees rather than <271.9, 126.8> m/s. Thats just my thought on the subject, hope it helps.
Brendan
Brendan"Mathematics is the Queen of the Sciences, and Arithmetic the Queen of Mathematics" -Gauss

This topic is closed to new replies.

Advertisement