Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-01-09 00:16:24 +0300
committerTon Roosendaal <ton@blender.org>2005-01-09 00:16:24 +0300
commit3c921cc8e88d56ba206797e6dd990451274603c6 (patch)
tree359e66b006f20ecd49ed1f2bb3fb3ff06cd6137b /source/blender/blenlib/intern/arithb.c
parent9adbe1ec0e2888cb6c04a3cb0789ba1b7e7bf199 (diff)
The "teac" (measurement info) patch from Campbell Barton
Cleaned code somewhat (half the size!) and applied some changes: - made it compatible with selection flags for new mesh editing (edge/face) - renamed 'face angles' to 'edge angles' and made it display angles for 2 selected edges too - removed the confusing convention that always drawed the info if one of the vertices of edge/face/angle was selected. now it only displays on minimum of 1 full edge or face selected. - made it react to "zbuf occluded selection" option (for zbuffered text) - made it also colorize text for white theme color (TH_TEXT) On larger meshes this info still draws very confusing. The idea of displaying the info on 1 vertex selected was probably to show values while grabbing, although that didnt really work for angles. One idea could be, for transform, that it draws all lenghts/angles/areas that get changed during transform All in all, still useful addition tho!
Diffstat (limited to 'source/blender/blenlib/intern/arithb.c')
-rw-r--r--source/blender/blenlib/intern/arithb.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
index c4dd5de3a0e..1c56bba45a4 100644
--- a/source/blender/blenlib/intern/arithb.c
+++ b/source/blender/blenlib/intern/arithb.c
@@ -2205,6 +2205,20 @@ void VecRotToQuat( float *vec, float phi, float *quat)
}
}
+/* Return the angle in degrees between vecs 1-2 and 2-3 */
+float VecAngle3( float *v1, float *v2, float *v3)
+{
+ float vec1[3], vec2[3];
+
+ VecSubf(vec1, v2, v1);
+ VecSubf(vec2, v3, v1);
+ Normalise(vec1);
+ Normalise(vec2);
+
+ return saacos(vec1[0]*vec2[0] + vec1[1]*vec2[1] + vec1[2]*vec2[2]) * 360.0/M_PI;
+}
+
+
void euler_rot(float *beul, float ang, char axis)
{
float eul[3], mat1[3][3], mat2[3][3], totmat[3][3];