New patches:
[added quadrics
jeanphilippe.bernardy@gmail.com**20050616084016] {
hunk ./HRayMath.lhs 37
+> | Quadric Point3D Vector Double -- center, director, const
+
+Equation of (Quadric c d k) is (norm (x-c) == abs ( d .* (x-c)) + k)
+let e = norm d, then
+e = 0 => sphere
+0 < e < 1 => ellipsoid
+e = 1 => cylinder
+e > 1 => hyperboloid (or cone, when k = 0)
+
+I suppose paraboloid can be approached for some value of e, but it remains to be shown.
hunk ./HRayMath.lhs 150
+
+This should be modified to use the general 2nd degree solver, but I'm wary of untested modifications.
+
+> intRayWith (Ray source ray) (Quadric center dir sqk0) = [(b - sqrt d)/a, (b + sqrt d)/a]
+> where a = 1 - sq (ray *. dir)
+> b = ray *. ((dir <-> c0) *> (c0 *. dir))
+> c = squaredNorm c0 - sqk0 - sq (c0 *. dir)
+> c0 = source <-> center
+> d = b * b - a * c
+> sq x = x * x
+
+> squaredNorm v = v *. v
+
+
+follows my code to select the solution nearest to the cam, for reference.
+
+ d = b * b - a * c
+ sol1 = (b - sqrt d)/a
+ sol2 = (b + sqrt d)/a
+ sol = if a > 0 then sol1 else sol2
+ -- the good solution depends on the concavity/convexy of the curve
+ solution = if d >= 0 && sol > 0 then sol else infinite
+
hunk ./HRayMath.lhs 185
+
+> normal hit (Quadric center dir k) = norm (v <-> (dir *> c))
+> where v = hit <-> center
+> c = dir *. v
+
}
Context:
[Name change of imported module
Duncan Coutts **20050613145737]
[Switch to using unsafe indexing in the pixbufSetPixelsRGB8 function since we are confident that we've got the indexing correct.
Duncan Coutts **20050613145628]
[Actually implement the "assert that the format is RGB8" comment and add a couple more comments.
Duncan Coutts **20050613145538]
[Use new MArray based Pixbuf API (pixbufGetPixels) and use doFromTo loop function
Duncan Coutts **20050613145350]
[complete the rename, update the module description and remove -fffi option since it is no longer needed.
Duncan Coutts **20050613144741]
[Rename PixBufInternals.lhs to PixBufExtras.lhs to reflect the fact that we are now only using the public API.
Duncan Coutts **20050613144544]
[Remove bits of PixBufInternals.lhs that we don't need anymore.
Duncan Coutts **20050613144455]
[HRay1.0
Kenneth Hoste **20050531231411]
Patch bundle hash:
9db88a7246c72a2733b08958136c786ebaa9db9e