]> granicus.if.org Git - graphviz/commitdiff
smyrna 3D navigation tune up
authorarif <devnull@localhost>
Mon, 21 Sep 2009 18:59:38 +0000 (18:59 +0000)
committerarif <devnull@localhost>
Mon, 21 Sep 2009 18:59:38 +0000 (18:59 +0000)
cmd/smyrna/glexpose.c
cmd/smyrna/smyrnadefs.h
cmd/smyrna/topview.c

index ad0fdfcea787d902be9a54f4f45f3006dabbfbcb..5d73156b058258032370678637787271f2123810 100644 (file)
@@ -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();
 
index 0cd9e74a14ffb4025576bea2cde23a9073448537..7f349f8b495163563b58b07c528eaed372e21604 100644 (file)
@@ -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
index 9b00aacc3b4627f6096a4b1a48dfc66d8042bfaa..4c7ecd90b5080d75000adea09ada00f1fab8b7e1 100755 (executable)
@@ -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;
+
+