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:
authorMatt Ebb <matt@mke3.net>2006-10-12 11:54:32 +0400
committerMatt Ebb <matt@mke3.net>2006-10-12 11:54:32 +0400
commit1be92c8b19cf63890bae3e409a4ede563bae7200 (patch)
treebc6aa4886d815e93a3f4e273662097ab6e17a76e /source/blender/src/drawobject.c
parent14a94607557a2436cd187b6e7d89ee418a3eedf0 (diff)
* Added a new empty draw type - single arrow. This can be useful in situations
where you just need a direction, like a wind or vortex force field for example.
Diffstat (limited to 'source/blender/src/drawobject.c')
-rw-r--r--source/blender/src/drawobject.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index dd82be68af4..2df2e771696 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -256,6 +256,9 @@ static float cube[8][3] = {
void drawaxes(float size, int flag, char drawtype)
{
int axis;
+ float v1[3]= {0.0, 0.0, 0.0};
+ float v2[3]= {0.0, 0.0, 0.0};
+ float v3[3]= {0.0, 0.0, 0.0};
switch(drawtype) {
@@ -274,6 +277,39 @@ void drawaxes(float size, int flag, char drawtype)
glEnd();
}
break;
+ case OB_SINGLE_ARROW:
+
+ glBegin(GL_LINES);
+ /* in positive z direction only */
+ v1[2]= size;
+ glVertex3fv(v1);
+ glVertex3fv(v2);
+ glEnd();
+
+ /* square pyramid */
+ glBegin(GL_TRIANGLES);
+
+ v2[0]= size*0.035; v2[1] = size*0.035;
+ v3[0]= size*-0.035; v3[1] = size*0.035;
+ v2[2]= v3[2]= size*0.75;
+
+ for (axis=0; axis<4; axis++) {
+ if (axis % 2 == 1) {
+ v2[0] *= -1;
+ v3[1] *= -1;
+ } else {
+ v2[1] *= -1;
+ v3[0] *= -1;
+ }
+
+ glVertex3fv(v1);
+ glVertex3fv(v2);
+ glVertex3fv(v3);
+
+ }
+ glEnd();
+
+ break;
case OB_ARROWS:
default:
for (axis=0; axis<3; axis++) {