From 1fe7799e3c2f560393fec4534a5378df07af7a09 Mon Sep 17 00:00:00 2001 From: arif Date: Mon, 21 Sep 2009 18:59:38 +0000 Subject: [PATCH] smyrna 3D navigation tune up --- cmd/smyrna/glexpose.c | 8 +++++--- cmd/smyrna/smyrnadefs.h | 1 + cmd/smyrna/topview.c | 38 +++++++++++++++++++++++++++++++++++--- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/cmd/smyrna/glexpose.c b/cmd/smyrna/glexpose.c index ad0fdfcea..5d73156b0 100644 --- a/cmd/smyrna/glexpose.c +++ b/cmd/smyrna/glexpose.c @@ -78,9 +78,11 @@ int glupdatecamera(ViewInfo * view) /*toggle to active camera*/ else { - gluLookAt(view->cameras[view->active_camera]->targetx, view->cameras[view->active_camera]->targety, 20, view->cameras[view->active_camera]->targetx, - view->cameras[view->active_camera]->targety, 0.0, 0.0, 1.0, 0.0); glMultMatrixf(view->arcball->Transform.M); /*arcball transformations , experimental*/ +/* gluLookAt(view->cameras[view->active_camera]->targetx, view->cameras[view->active_camera]->targety, 20, view->cameras[view->active_camera]->targetx, + view->cameras[view->active_camera]->targety, 0.0, 0.0, 1.0, 0.0);*/ + glTranslatef(-view->cameras[view->active_camera]->targetx,-view->cameras[view->active_camera]->targety,0); +// printf(" %f %f %f \n",view->panx,view->pany,view-> } GetOGLPosRef(1, view->h - 5, &(view->clipX1), &(view->clipY1), @@ -265,7 +267,7 @@ void drawRotatingAxis(void) glEnd(); glColor4f(0,1,0,0.3); - gluSphere(quadratic,45,20,20); + gluSphere(quadratic,AL,20,20); glLineWidth(1); glPopMatrix(); diff --git a/cmd/smyrna/smyrnadefs.h b/cmd/smyrna/smyrnadefs.h index 0cd9e74a1..7f349f8b4 100644 --- a/cmd/smyrna/smyrnadefs.h +++ b/cmd/smyrna/smyrnadefs.h @@ -67,6 +67,7 @@ #define ZOOM_STEP 0.5 #define DEG2RAD G_PI/180 +#define RAD2DEG 1/0.017453292519943 #define UNHIGHLIGHTED_ALPHA 0.3 #define Z_FORWARD_PLANE -0.00201 diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c index 9b00aacc3..4c7ecd90b 100755 --- a/cmd/smyrna/topview.c +++ b/cmd/smyrna/topview.c @@ -1592,10 +1592,34 @@ static void switch2D3D(void *p) } } +static viewMatrice(int n,int m,float* mtx) +{ + int i,i2; + printf ("Transformation Matrix\n"); + i=i2=0; + for (i=0; i < n * m; i ++) + { +/* if (i==5) + printf ("tetX:%f ",asin(mtx[i]) * RAD2DEG); //around x , right hand notion + if (i==0) + printf ("tetZ:%f ",asin(mtx[i]) * RAD2DEG); //around x , right hand notion + if (i==5) + printf ("tetX:%f ",asin(mtx[i]) * RAD2DEG); //around x , right hand notion*/ + printf ("%f ",asin(mtx[i]) * RAD2DEG); //around x , right hand notion*/ + i2++; + if (i2 == m) + { + i2=0; + printf ("\n"); + } + } +} - - - +static void test_btn_callback(void* p) +{ +// viewMatrice (4,4,view->arcball->Transform.M); + viewMatrice (3,3,view->arcball->ThisRot.M); +} static char *smyrna_icon_pan; static char *smyrna_icon_zoom; @@ -1760,6 +1784,14 @@ glCompSet *glcreate_gl_topview_menu(void) glCompSetAddButton(s, b); b->callbackfunc = menu_switch_to_fisheye; + b = glCompButtonNew(140, 5, 75, 25, "Test Btn", '\0', 0, 0,scientific_y); + b->panel = p; + b->groupid = 0; + b->customptr = view; + glCompSetAddButton(s, b); + b->callbackfunc = test_btn_callback; + + -- 2.40.0