]> granicus.if.org Git - graphviz/commitdiff
new 3d navigation
authorarif <devnull@localhost>
Wed, 9 Apr 2008 18:52:26 +0000 (18:52 +0000)
committerarif <devnull@localhost>
Wed, 9 Apr 2008 18:52:26 +0000 (18:52 +0000)
cmd/smyrna/glexpose.c
cmd/smyrna/gltemplate.c
cmd/smyrna/smyrnadefs.h
cmd/smyrna/viewportcamera.c

index 77b8092ca7900094290b88ed8b13ce34dff7f5f2..a40c2595275d109d0b5f9256b4bc98d490984459 100644 (file)
@@ -38,11 +38,17 @@ int glupdatecamera(ViewInfo * view)
        /*toggle to active camera*/
        else
        {
-               gluLookAt(view->cameras[view->active_camera]->x,view->cameras[view->active_camera]->y,view->cameras[view->active_camera]->z,
+               /*gluLookAt(view->cameras[view->active_camera]->x,view->cameras[view->active_camera]->y,view->cameras[view->active_camera]->z,
                view->cameras[view->active_camera]->targetx,view->cameras[view->active_camera]->targety,view->cameras[view->active_camera]->targetz,
                view->cameras[view->active_camera]->camera_vectorx,
                view->cameras[view->active_camera]->camera_vectory,
-               view->cameras[view->active_camera]->camera_vectorz);
+               view->cameras[view->active_camera]->camera_vectorz);*/
+               gluLookAt(view->panx, view->pany, view->zoom * -1, view->panx,
+                       view->pany, 0.0, 0.0, 1.0, 0.0);
+                       glRotatef(view->cameras[view->active_camera]->angley,1,0,0);
+                       glRotatef(view->cameras[view->active_camera]->anglex,0,1,0);
+
+
        }
        GetOGLPosRef(1, view->h - 5, &(view->clipX1), &(view->clipY1),
                 &(view->clipZ1));
index 35f014628a763f2e86aab03968c1975ea59420ad..c1dd5123666366c11cde3d784018a90066072b65 100755 (executable)
@@ -369,9 +369,9 @@ static gboolean motion_notify_event(GtkWidget * widget,
                }
                else
                {
-                       view->cameras[view->active_camera]->anglexyz+=gldy;
-                       view->cameras[view->active_camera]->anglexy+=gldx;
-                       set_camera_x_y(view->cameras[view->active_camera]);
+                       view->cameras[view->active_camera]->angley-=dy/5;
+                       view->cameras[view->active_camera]->anglex-=dx/5;
+//                     set_camera_x_y(view->cameras[view->active_camera]);
                }
                redraw = TRUE;
        }
index ae1a4c676633ea2c1890aa9e12a6c32f484643db..48bfeba2318e885056ef2b907f7f642c919e5747 100644 (file)
@@ -144,6 +144,10 @@ typedef struct _viewport_camera{
        float anglexy;
        float anglexyz;
 
+       float anglex;
+       float angley;
+
+
        float camera_vectorx;
        float camera_vectory;
        float camera_vectorz;
index b2d19b56b0f2fbfbfdd0ff3af09f9481ca76a52e..8044dd982902d4add18eb77b8deb72bacfb4e860 100644 (file)
@@ -91,14 +91,20 @@ void menu_click_add_camera(void *p)
        c->targetx=view->panx;
        c->targety=view->pany;
        c->targetz=view->panz;
+       c->x=view->panx;
+       c->y=view->pany;
+       c->z=view->zoom;
        c->camera_vectorx=0;
        c->camera_vectory=1;
        c->camera_vectorz=0;
 
        c->anglexy=90;
        c->anglexyz=0;
+       c->anglex=0;
+       c->angley=0;
+
        c->r=view->zoom*-1;
-       set_camera_x_y(c);
+//     set_camera_x_y(c);
        attach_camera_widget(view);