Changeset 404 for trunk/gui/vizservers/nanovis
- Timestamp:
- Apr 17, 2006, 6:28:46 PM (18 years ago)
- Location:
- trunk/gui/vizservers/nanovis
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/vizservers/nanovis/Lic.cpp
r401 r404 37 37 { 38 38 scale = Vector3(scalex, scaley, scalez); 39 slice_vector = new float[ NMESH*NMESH*4];39 slice_vector = new float[size*size*4]; 40 40 41 41 //initialize the pattern texture -
trunk/gui/vizservers/nanovis/Lic.h
r401 r404 40 40 int width, height; 41 41 int size; //the lic is a square of size, it can be stretched 42 float* slice_vector; //storage for the per slice vectors driving the follow42 float* slice_vector; //storage for the per slice vectors driving the follow 43 43 Vector3 scale; //scaling factor stretching the lic plane to fit the actual dimensions 44 44 float offset; //[0,1] offset could be x, y, or z direction … … 65 65 public: 66 66 Vector3 normal; //the normal vector of the Lic plane, 67 //the inherited Vector3 location is its center67 //the inherited Vector3 location is its center 68 68 Lic(int _size, int _width, int _height, float _offset, 69 69 CGcontext _context, NVISid _vector_field, -
trunk/gui/vizservers/nanovis/Makefile
r401 r404 3 3 PerfQuery.o TransferFunction.o ControlPoint.o ColorGradient.o ColorPaletteWindow.o\ 4 4 ColorGradientGLUTWindow.o TransferFunctionGLUTWindow.o MainWindow.o Event.o \ 5 Lic.o Renderable.o 5 Lic.o Renderable.o Camera.o 6 6 7 7 OBJ_CLIENT = Socket.o ClientSocket.o RenderClient.o Event.o … … 88 88 gcc $(CFLAG) ParticleSystem.cpp 89 89 90 Renderable.o: Renderable.cpp90 Renderable.o: Vector3.o Renderable.cpp 91 91 gcc $(CFLAG) Renderable.cpp 92 93 Camera.o: Vector3.o Camera.cpp 94 gcc $(CFLAG) Camera.cpp 92 95 93 96 Lic.o: Renderable.o Lic.cpp Lic.h $(AUXSRC) -
trunk/gui/vizservers/nanovis/Sphere.cpp
r401 r404 41 41 //draw it 42 42 gluSphere(quad, radius, stack, slice); 43 43 44 glPopMatrix(); 44 45 } -
trunk/gui/vizservers/nanovis/nanovis.cpp
r401 r404 35 35 //render server 36 36 37 Camera* cam; 37 38 float color_table[256][4]; 38 39 … … 74 75 //Nvidia CG shaders and their parameters 75 76 CGcontext g_context; 76 CGprogram m_pos_fprog;77 CGparameter m_vel_tex_param, m_pos_tex_param;78 CGparameter m_pos_timestep_param, m_pos_spherePos_param;79 80 CGprogram m_vel_fprog;81 CGparameter m_vel_timestep_param, m_vel_damping_param, m_vel_gravity_param;82 CGparameter m_vel_spherePos_param, m_vel_sphereVel_param, m_vel_sphereRadius_param;83 77 84 78 CGprogram m_passthru_fprog; … … 98 92 CGparameter m_mvi_vert_std_param; 99 93 100 101 94 using namespace std; 102 95 … … 106 99 live_rot_z = z_angle; 107 100 } 108 109 101 110 102 … … 850 842 init_glew(); 851 843 852 glViewport(0, 0, (GLsizei) NPIX, (GLsizei) NPIX);853 glMatrixMode(GL_PROJECTION);854 glLoadIdentity(); 855 glTranslatef(-1.0, -1.0, 0.0); 856 glScalef(2.0, 2.0, 1.0);844 //create the camera with default setting 845 cam = new Camera(win_width, win_height, 846 live_obj_x, live_obj_y, live_obj_z, 847 0., 0., 100., 848 live_rot_x, live_rot_y, live_rot_z); 857 849 858 850 glEnable(GL_TEXTURE_2D); … … 1513 1505 glDisable(GL_BLEND); 1514 1506 1515 int segments = 20;1507 int segments = 50; 1516 1508 1517 1509 glColor3f(0.8, 0.8, 0.8); 1518 1510 glPushMatrix(); 1519 glTranslatef( -0.45, -0.5, -0.5);1520 glScalef(0.00 1, 0.001, 0.001);1511 glTranslatef(0.4, 0., 0.); 1512 glScalef(0.0005, 0.0005, 0.0005); 1521 1513 glutStrokeCharacter(GLUT_STROKE_ROMAN, 'x'); 1522 1514 glPopMatrix(); 1523 1515 1524 1516 glPushMatrix(); 1525 glTranslatef( -0.7, -0.25, -0.5);1526 glScalef(0.00 1, 0.001, 0.001);1517 glTranslatef(0., 0.4, 0.); 1518 glScalef(0.0005, 0.0005, 0.0005); 1527 1519 glutStrokeCharacter(GLUT_STROKE_ROMAN, 'y'); 1528 1520 glPopMatrix(); 1529 1521 1530 1522 glPushMatrix(); 1531 glTranslatef( -0.7, -0.5, -0.2);1532 glScalef(0.00 1, 0.001, 0.001);1523 glTranslatef(0., 0., 0.4); 1524 glScalef(0.0005, 0.0005, 0.0005); 1533 1525 glutStrokeCharacter(GLUT_STROKE_ROMAN, 'z'); 1534 1526 glPopMatrix(); … … 1539 1531 glColor3f(0.2, 0.2, 0.8); 1540 1532 glPushMatrix(); 1541 glTranslatef(-0.7, -0.5, -0.5);1542 1533 glutSolidSphere(0.02, segments, segments ); 1543 1534 glPopMatrix(); 1544 1535 1545 1536 glPushMatrix(); 1546 glTranslatef(-0.7, -0.5, -0.5);1547 1537 glRotatef(-90, 1, 0, 0); 1548 gluCylinder(obj, 0.01, 0.01, 0. 15, segments, segments);1538 gluCylinder(obj, 0.01, 0.01, 0.3, segments, segments); 1549 1539 glPopMatrix(); 1550 1540 1551 1541 glPushMatrix(); 1552 glTranslatef( -0.7, -0.35, -0.5);1542 glTranslatef(0., 0.3, 0.); 1553 1543 glRotatef(-90, 1, 0, 0); 1554 1544 gluCylinder(obj, 0.02, 0.0, 0.06, segments, segments); … … 1556 1546 1557 1547 glPushMatrix(); 1558 glTranslatef(-0.7, -0.5, -0.5);1559 1548 glRotatef(90, 0, 1, 0); 1560 gluCylinder(obj, 0.01, 0.01, 0. 15, segments, segments);1549 gluCylinder(obj, 0.01, 0.01, 0.3, segments, segments); 1561 1550 glPopMatrix(); 1562 1551 1563 1552 glPushMatrix(); 1564 glTranslatef( -0.55, -0.5, -0.5);1553 glTranslatef(0.3, 0., 0.); 1565 1554 glRotatef(90, 0, 1, 0); 1566 1555 gluCylinder(obj, 0.02, 0.0, 0.06, segments, segments); … … 1568 1557 1569 1558 glPushMatrix(); 1570 glTranslatef(-0.7, -0.5, -0.5); 1571 gluCylinder(obj, 0.01, 0.01, 0.15, segments, segments); 1559 gluCylinder(obj, 0.01, 0.01, 0.3, segments, segments); 1572 1560 glPopMatrix(); 1573 1561 1574 1562 glPushMatrix(); 1575 glTranslatef( -0.7, -0.5, -0.35);1563 glTranslatef(0., 0., 0.3); 1576 1564 gluCylinder(obj, 0.02, 0.0, 0.06, segments, segments); 1577 1565 glPopMatrix(); … … 1598 1586 glEnd(); 1599 1587 1600 1601 1588 //blue y 1602 1589 glColor3f(0,0,1); … … 1606 1593 glEnd(); 1607 1594 1608 1609 1595 //green z 1610 1596 glColor3f(0,1,0); … … 1640 1626 glEnable(GL_DEPTH_TEST); 1641 1627 1642 glViewport(0, 0, NPIX, NPIX); 1643 glMatrixMode(GL_PROJECTION); 1644 glLoadIdentity(); 1645 gluPerspective(60, (GLdouble)1, 0.1, 50.0); 1646 1647 glMatrixMode(GL_MODELVIEW); 1648 glLoadIdentity(); 1649 glTranslatef(live_obj_x, live_obj_y, live_obj_z); 1650 1651 glRotated(live_rot_x, 1., 0., 0.); 1652 glRotated(live_rot_y, 0., 1., 0.); 1653 glRotated(live_rot_z, 0., 0., 1.); 1654 1628 //camera setting activated 1629 cam->activate(); 1630 1631 //now render things in the scene 1632 // 1655 1633 draw_3d_axis(); 1656 1634 … … 1742 1720 else if(live_rot_y < -360.0) 1743 1721 live_rot_y += 360.0; 1722 1723 cam->rotate(live_rot_x, live_rot_y, live_rot_z); 1744 1724 } 1745 1725 … … 1792 1772 live_obj_z-=0.05; 1793 1773 log = true; 1774 cam->move(live_obj_x, live_obj_y, live_obj_z); 1794 1775 break; 1795 1776 case 's': //zoom in 1796 1777 live_obj_z+=0.05; 1797 1778 log = true; 1779 cam->move(live_obj_x, live_obj_y, live_obj_z); 1798 1780 break; 1799 1781 case 'a': //left 1800 1782 live_obj_x-=0.05; 1801 1783 log = true; 1784 cam->move(live_obj_x, live_obj_y, live_obj_z); 1802 1785 break; 1803 1786 case 'd': //right 1804 1787 live_obj_x+=0.05; 1805 1788 log = true; 1789 cam->move(live_obj_x, live_obj_y, live_obj_z); 1806 1790 break; 1807 1791 case 'i': -
trunk/gui/vizservers/nanovis/nanovis.h
r397 r404 28 28 #include "global.h" 29 29 #include "socket/Socket.h" 30 #include " RenderVertexArray.h"30 #include "Camera.h" 31 31 #include "ConvexPolygon.h" 32 32 #include "Texture3D.h"
Note: See TracChangeset
for help on using the changeset viewer.