@Julz: I was thinking the same thing this morning when I was walkin to the gas-station.. (Yes, I do think about this stuff in my free time.. lol)

You'd need a third vertex, as said above. With this, you find the angle from the center of the other two vertices. Then [somehow] roll it to match...

var p1[3]; var p2[3];
var centerPoint[3];

vec_for_vertex(p1, my, ...);
vec_for_vertex(p2, my, ...);
vec_diff(temp, p2, p1);
vec_scale(temp, 0.5);
vec_add(temp, p1);
vec_set(centerPoint, temp);

// CenterPoint now contains a point between the two vertices.
// Now you need to find the direction to the third...

var p3[3];
var centerAngle[3];
vec_for_vertex(p3, my, ...);
vec_diff(temp, p3, centerPoint);
vec_to_angle(centerAngle, temp);

// centerAngle now contains a pan/tilt pointing to the centerPoint.
// Now find a way to convert this to roll...


xXxGuitar511
- Programmer