Quote Originally Posted by jdarling
Oh wait, I'm an idiot who misread the theory LOL. Your right, the division by mass inside the integration step isn't necessary. By removing it you get proper reaction of a V2=M1*2*V1 (or an object with twice the mass should have twice the velocity as another object).

Ok, well that fixes that. Now, back to the problem of the bouncing balls and sticks
Good to see you got that bit working

Now back to reflection rays you were wanting...

Here is the code I use in my raytracer for calculating a reflection ray, and it doesn't use any trigonometry at all

[pascal] // calculate reflection
refl := prim.Material.Reflection;
If refl > 0.0 Then
Begin
If ADepth < FMaxTraceDepth Then
// spawn secondary rays
Begin
N := prim.GetNormalAt(pi);
R := VectorSub(ARay.Direction,VectorScale(N,2.0 * DotProduct(ARay.Direction,N)));
rcol := Color4f(0, 0, 0);
reflray.Origin := VectorAdd(pi,VectorScale(R,cEpsilon));
reflray.Direction := R;
Raytrace(reflray, rcol, ADepth + 1, ARIndex, dist);
AAcc.r := AAcc.r + refl * rcol.r * primColor.r;
AAcc.g := AAcc.g + refl * rcol.g * primColor.g;
AAcc.b := AAcc.b + refl * rcol.b * primColor.b;
End;
End;
[/pascal]

I hope it helps
cheers,
Paul