Hi there,
I am trying to orientate a Sketchup model along a plane.
The plane is defined by three points.
I am using the math3d.js published with the plugin examples (*).
Given the points a, b and c in cartesian coordinates
I calculated the orientation matrix of the plane.
var ab = V3.sub(b, a)
var ac = V3.sub(c, a)
var dir = V3.sub(c, a)
var up = V3.cross(ab, ac)
// orientation_matrix
var mat = M33.makeOrthonormalFrame(dir, up);
Now, the M33.localOrientationMatrixToHeadingTiltRoll(mat) function of
math3d.js should give me the corresponding heading, tilt and roll
values but I get weird results.
Find an example here:
http://l-p-n.de/tmp/ge/argh.html
Help on solving this problem is very appreciatated!
Regards,
Laurens
(*)
http://code.google.com/p/earth-api-samples/source/browse/trunk/lib/math3d.js