diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-12-21 13:52:57 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-12-21 13:52:57 +0300 |
commit | db77f6abd7148d0548a864c5c28beab5de3c4e79 (patch) | |
tree | ab8a5527ed259de24eba79b9212680a9fb2430c5 /source/blender/editors | |
parent | 170b748c81b7e76fefb74d5ae2fe45767085aa91 (diff) |
2.5 - Ported new-style 'sphere' drawtype for empties from animsys2. This draws in a much simpler/cleaner way, with only 3 disks, which should help distinguish it from standard geometry.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index e8323318130..bcb2b8b8e35 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3964,18 +3964,35 @@ static void drawnurb(Scene *scene, View3D *v3d, Base *base, Nurb *nurb, int dt) /* draw a sphere for use as an empty drawtype */ static void draw_empty_sphere (float size) { - float cent=0; - GLUquadricObj *qobj = gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); + static GLuint displist=0; + + if (displist == 0) { + GLUquadricObj *qobj; - glPushMatrix(); - glTranslatef(cent, cent, cent); - glScalef(size, size, size); - gluSphere(qobj, 1.0, 8, 5); + displist= glGenLists(1); + glNewList(displist, GL_COMPILE_AND_EXECUTE); - glPopMatrix(); + glPushMatrix(); + + qobj = gluNewQuadric(); + gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); + gluDisk(qobj, 0.0, 1, 16, 1); + + glRotatef(90, 0, 1, 0); + gluDisk(qobj, 0.0, 1, 16, 1); + + glRotatef(90, 1, 0, 0); + gluDisk(qobj, 0.0, 1, 16, 1); + + gluDeleteQuadric(qobj); + + glPopMatrix(); + glEndList(); + } - gluDeleteQuadric(qobj); + glScalef(size, size, size); + glCallList(displist); + glScalef(1/size, 1/size, 1/size); } /* draw a cone for use as an empty drawtype */ |