aboutsummaryrefslogtreecommitdiff
path: root/src/glbits.c
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2008-01-09 16:26:00 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2008-01-09 16:26:00 +0000
commitf501217162d7c2cb43c4ce226e37173ef9cfba4c (patch)
tree0a1ca776768675a2b9433701e340582a49dbfd5b /src/glbits.c
parent6598142c03d177aaa4b021469bff8704bf384634 (diff)
Colour a*, b* and c* axes
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@246 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/glbits.c')
-rw-r--r--src/glbits.c45
1 files changed, 37 insertions, 8 deletions
diff --git a/src/glbits.c b/src/glbits.c
index 8a97925..cd9f51c 100644
--- a/src/glbits.c
+++ b/src/glbits.c
@@ -143,6 +143,7 @@ void glbits_prepare(DisplayWindow *dw) {
GLfloat bblue[] = { 0.0, 0.0, 1.0, 1.0 };
GLfloat blue[] = { 0.0, 0.0, 0.5, 1.0 };
+ GLfloat purple[] = { 0.7, 0.0, 1.0, 1.0 };
GLfloat red[] = { 1.0, 0.0, 0.0, 1.0 };
GLfloat green[] = { 0.0, 1.0, 0.0, 1.0 };
GLfloat yellow[] = { 1.0, 1.0, 0.0, 1.0 };
@@ -504,52 +505,80 @@ void glbits_prepare(DisplayWindow *dw) {
/* Draw the reciprocal unit cell if one is available */
if ( ctx->cell && !dw->lines ) {
- glBegin(GL_LINE_STRIP);
- glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, red);
+
+ glBegin(GL_LINES);
+
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, black);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, black);
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 0.0);
glNormal3f(1.0, 0.0, 0.0);
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, red);
+ glVertex3f(0.0, 0.0, 0.0);
+ glVertex3f(ctx->cell->a.x/1e9, ctx->cell->a.y/1e9, ctx->cell->a.z/1e9);
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, green);
glVertex3f(0.0, 0.0, 0.0);
+ glVertex3f(ctx->cell->b.x/1e9, ctx->cell->b.y/1e9, ctx->cell->b.z/1e9);
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, bblue);
+ glVertex3f(0.0, 0.0, 0.0);
+ glVertex3f(ctx->cell->c.x/1e9, ctx->cell->c.y/1e9, ctx->cell->c.z/1e9);
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, purple);
glVertex3f(ctx->cell->a.x/1e9, ctx->cell->a.y/1e9, ctx->cell->a.z/1e9);
glVertex3f(ctx->cell->a.x/1e9 + ctx->cell->b.x/1e9,
ctx->cell->a.y/1e9 + ctx->cell->b.y/1e9,
ctx->cell->a.z/1e9 + ctx->cell->b.z/1e9);
+
+ glVertex3f(ctx->cell->a.x/1e9 + ctx->cell->b.x/1e9,
+ ctx->cell->a.y/1e9 + ctx->cell->b.y/1e9,
+ ctx->cell->a.z/1e9 + ctx->cell->b.z/1e9);
glVertex3f(ctx->cell->b.x/1e9, ctx->cell->b.y/1e9, ctx->cell->b.z/1e9);
- glVertex3f(0.0, 0.0, 0.0);
+
glVertex3f(ctx->cell->c.x/1e9, ctx->cell->c.y/1e9, ctx->cell->c.z/1e9);
glVertex3f(ctx->cell->c.x/1e9 + ctx->cell->a.x/1e9,
ctx->cell->c.y/1e9 + ctx->cell->a.y/1e9,
ctx->cell->c.z/1e9 + ctx->cell->a.z/1e9);
+
+ glVertex3f(ctx->cell->c.x/1e9 + ctx->cell->a.x/1e9,
+ ctx->cell->c.y/1e9 + ctx->cell->a.y/1e9,
+ ctx->cell->c.z/1e9 + ctx->cell->a.z/1e9);
+ glVertex3f(ctx->cell->c.x/1e9 + ctx->cell->a.x/1e9 + ctx->cell->b.x/1e9,
+ ctx->cell->c.y/1e9 + ctx->cell->a.y/1e9 + ctx->cell->b.y/1e9,
+ ctx->cell->c.z/1e9 + ctx->cell->a.z/1e9 + ctx->cell->b.z/1e9);
+
glVertex3f(ctx->cell->c.x/1e9 + ctx->cell->a.x/1e9 + ctx->cell->b.x/1e9,
ctx->cell->c.y/1e9 + ctx->cell->a.y/1e9 + ctx->cell->b.y/1e9,
ctx->cell->c.z/1e9 + ctx->cell->a.z/1e9 + ctx->cell->b.z/1e9);
glVertex3f(ctx->cell->c.x/1e9 + ctx->cell->b.x/1e9,
ctx->cell->c.y/1e9 + ctx->cell->b.y/1e9,
ctx->cell->c.z/1e9 + ctx->cell->b.z/1e9);
- glVertex3f(ctx->cell->c.x/1e9, ctx->cell->c.y/1e9, ctx->cell->c.z/1e9);
glVertex3f(ctx->cell->c.x/1e9 + ctx->cell->b.x/1e9,
ctx->cell->c.y/1e9 + ctx->cell->b.y/1e9,
ctx->cell->c.z/1e9 + ctx->cell->b.z/1e9);
- glVertex3f(ctx->cell->b.x/1e9, ctx->cell->b.y/1e9, ctx->cell->b.z/1e9);
+ glVertex3f(ctx->cell->c.x/1e9, ctx->cell->c.y/1e9, ctx->cell->c.z/1e9);
+
glVertex3f(ctx->cell->c.x/1e9 + ctx->cell->b.x/1e9,
ctx->cell->c.y/1e9 + ctx->cell->b.y/1e9,
ctx->cell->c.z/1e9 + ctx->cell->b.z/1e9);
+ glVertex3f(ctx->cell->b.x/1e9, ctx->cell->b.y/1e9, ctx->cell->b.z/1e9);
+
glVertex3f(ctx->cell->c.x/1e9 + ctx->cell->a.x/1e9 + ctx->cell->b.x/1e9,
ctx->cell->c.y/1e9 + ctx->cell->a.y/1e9 + ctx->cell->b.y/1e9,
ctx->cell->c.z/1e9 + ctx->cell->a.z/1e9 + ctx->cell->b.z/1e9);
glVertex3f(ctx->cell->a.x/1e9 + ctx->cell->b.x/1e9,
ctx->cell->a.y/1e9 + ctx->cell->b.y/1e9,
ctx->cell->a.z/1e9 + ctx->cell->b.z/1e9);
- glVertex3f(ctx->cell->c.x/1e9 + ctx->cell->a.x/1e9 + ctx->cell->b.x/1e9,
- ctx->cell->c.y/1e9 + ctx->cell->a.y/1e9 + ctx->cell->b.y/1e9,
- ctx->cell->c.z/1e9 + ctx->cell->a.z/1e9 + ctx->cell->b.z/1e9);
+
glVertex3f(ctx->cell->c.x/1e9 + ctx->cell->a.x/1e9,
ctx->cell->c.y/1e9 + ctx->cell->a.y/1e9,
ctx->cell->c.z/1e9 + ctx->cell->a.z/1e9);
glVertex3f(ctx->cell->a.x/1e9, ctx->cell->a.y/1e9, ctx->cell->a.z/1e9);
+
glEnd();
+
}
/* Tilt axis */