Update of /cvsroot/playerstage/code/player/client_libs/libplayerc/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16237

Modified Files:
        test_graphics3d.c 
Log Message:
3d tests

Index: test_graphics3d.c
===================================================================
RCS file: 
/cvsroot/playerstage/code/player/client_libs/libplayerc/test/test_graphics3d.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_graphics3d.c   19 Jun 2007 02:01:08 -0000      1.1
--- test_graphics3d.c   20 Jun 2007 01:42:30 -0000      1.2
***************
*** 33,36 ****
--- 33,48 ----
    PASS();
  
+ 
+   TEST("changing color");
+   player_color_t col;
+   col.red = 0;
+   col.green = 0;
+   col.blue = 255;
+   col.alpha = 255;
+ 
+   if(playerc_graphics3d_setcolor(device, col) < 0)
+     FAIL();
+   else
+     PASS();
    
    player_point_3d_t pts[RAYS];
***************
*** 39,50 ****
    for( r=0; r<1.0; r+=0.05 )
      {
!       TEST("drawing points");
        
        int p;
        for( p=0; p<RAYS; p++ )
        {
!         pts[p].px = 100 * r * cos(p * M_PI/(RAYS/2));
!         pts[p].py = 100 * r * sin(p * M_PI/(RAYS/2));
!         pts[p].pz = 0;
  
          printf( "vertex [%.2f,%.2f,%.2f]\n",
--- 51,62 ----
    for( r=0; r<1.0; r+=0.05 )
      {
!       TEST("drawing line loop");
        
        int p;
        for( p=0; p<RAYS; p++ )
        {
!         pts[p].px = 5 * r * cos(p * M_PI/(RAYS/2));
!         pts[p].py = 5 * r * sin(p * M_PI/(RAYS/2));
!         pts[p].pz = 5 * r;
  
          printf( "vertex [%.2f,%.2f,%.2f]\n",
***************
*** 55,59 ****
        
        if( playerc_graphics3d_draw(device, 
!                                 PLAYER_DRAW_POINTS, 
                                  pts, RAYS) < 0)
        FAIL();
--- 67,71 ----
        
        if( playerc_graphics3d_draw(device, 
!                                 PLAYER_DRAW_LINE_LOOP, 
                                  pts, RAYS) < 0)
        FAIL();
***************
*** 61,73 ****
        PASS();
  
!       usleep(100000);
      }
    
    TEST("changing color");
!   player_color_t col;
!   col.red = 0;
!   col.green = 255;
!   col.blue = 0;
!   col.alpha = 0;
  
    if(playerc_graphics3d_setcolor(device, col) < 0)
--- 73,81 ----
        PASS();
  
!       usleep(50000);
      }
    
    TEST("changing color");
!   col.alpha = 60;
  
    if(playerc_graphics3d_setcolor(device, col) < 0)
***************
*** 76,83 ****
      PASS();
  
!   TEST("drawing polyline");
    
    if(playerc_graphics3d_draw(device, 
!                            PLAYER_DRAW_LINE_LOOP,
                             pts, RAYS) < 0)
      FAIL();
--- 84,91 ----
      PASS();
  
!   TEST("drawing polygon");
    
    if(playerc_graphics3d_draw(device, 
!                            PLAYER_DRAW_POLYGON,
                             pts, RAYS) < 0)
      FAIL();
***************
*** 85,95 ****
      PASS();
    
!   usleep(500000);
    
!   TEST("changing color");      
!   col.red = 0;
!   col.green = 128;
!   col.blue = 255;
!   col.alpha = 0;
    
    if(playerc_graphics3d_setcolor(device, col) < 0)
--- 93,103 ----
      PASS();
    
!   sleep(1);
    
!   TEST("changing color");
!   col.red = 0;//random() % 255;
!   col.green = 255;//random() % 255;
!   col.blue = 0;//random() % 255;
!   col.alpha = 255;
    
    if(playerc_graphics3d_setcolor(device, col) < 0)
***************
*** 97,130 ****
    else
      PASS();
! 
!   for( r=1.0; r>0; r-=0.1 )
      {
!       TEST("drawing polygon");
!       
!       player_point_3d_t pts[4];
!       pts[0].px = -r;
!       pts[0].py = -r;
!       pts[0].pz = 0;
!       pts[1].px = r;
!       pts[1].py = -r;
!       pts[1].pz = 0;
!       pts[2].px = r;
!       pts[2].py = r;
!       pts[2].pz = 0;
!       pts[3].px = -r;
!       pts[3].py = r;
!       pts[3].pz = 0;
        
!       if(playerc_graphics3d_draw(device, 
!                                PLAYER_DRAW_POLYGON,
!                                pts, 4 ) < 0)
        FAIL();
        else
        PASS();
-       
-       usleep(100000);
      }
  
!   sleep(2);
  
  
--- 105,125 ----
    else
      PASS();
!   
!   for( r=0; r<300; r++ )
      {
!       player_point_3d_t pt;
!       pt.px = fmod( rand(), 100 ) / 50.0 - 1.0;
!       pt.py = fmod( rand(), 100 ) / 50.0 - 1.0;
!       pt.pz = fmod( rand(), 100 ) / 30;
        
!       if( playerc_graphics3d_draw(device, 
!                                 PLAYER_DRAW_POINTS, 
!                                 &pt, 1) < 0)
        FAIL();
        else
        PASS();
      }
  
!   sleep(5);
  
  
***************
*** 136,139 ****
--- 131,135 ----
      PASS();
  
+   sleep( 1 );
  
    TEST("unsubscribing");


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to