Changeset 401
- Timestamp:
- Apr 10, 2006 7:49:34 AM (17 years ago)
- Location:
- trunk/gui/vizservers/nanovis
- Files:
-
- 5 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/vizservers/nanovis/Lic.cpp
r397 r401 24 24 CGcontext _context, NVISid _vector_field, 25 25 float scalex, float scaley, float scalez): 26 Renderable(Vector3(0.,0.,0.)), 26 27 size(_size), 27 28 offset(_offset), 28 29 m_g_context(_context), 29 display_width(_width),30 display_height(_height),30 width(_width), 31 height(_height), 31 32 iframe(0), 32 33 Npat(64), … … 78 79 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 79 80 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 80 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, display_width, display_height, 0,81 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, width, height, 0, 81 82 GL_RGB, GL_INT, NULL); 82 83 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, … … 293 294 } 294 295 296 void Lic::render(){ display(); } 297 298 295 299 void Lic::display(){ 296 300 -
trunk/gui/vizservers/nanovis/Lic.h
r397 r401 25 25 #include "global.h" 26 26 27 #include "Renderable.h" 27 28 #include "Vector3.h" 28 29 #include "Volume.h" 29 30 30 31 31 #define NPN 256 //resolution of background pattern … … 35 35 #define SCALE 3.0 //scale for background pattern. small value -> fine texture 36 36 37 class Lic {37 class Lic : public Renderable { 38 38 39 39 private: 40 int display_width, display_height;40 int width, height; 41 41 int size; //the lic is a square of size, it can be stretched 42 42 float* slice_vector; //storage for the per slice vectors driving the follow … … 64 64 65 65 public: 66 Vector3 normal; 66 Vector3 normal; //the normal vector of the Lic plane, 67 // the inherited Vector3 location is its center 67 68 Lic(int _size, int _width, int _height, float _offset, 68 69 69 CGcontext _context, NVISid _vector_field, 70 float scalex, float scaley, float scalez); 70 71 ~Lic(); 71 72 72 73 void convolve(); 73 74 void display(); //display the convolution result 75 void render(); 74 76 void make_patterns(); 75 77 void make_magnitudes(); -
trunk/gui/vizservers/nanovis/Makefile
r397 r401 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 5 Lic.o Renderable.o 6 6 7 7 OBJ_CLIENT = Socket.o ClientSocket.o RenderClient.o Event.o … … 70 70 gcc $(CFLAG) $(TFSRC)/ControlPoint.cpp 71 71 72 Sphere.o: Vector3.o Color.o72 Sphere.o: Renderable.o Color.o 73 73 gcc $(CFLAG) Sphere.cpp 74 74 … … 85 85 gcc $(CFLAG) Texture3D.cpp 86 86 87 ParticleSystem.o: ParticleSystem.cpp $(AUXSRC)87 ParticleSystem.o: Renderable.o ParticleSystem.cpp $(AUXSRC) 88 88 gcc $(CFLAG) ParticleSystem.cpp 89 89 90 Lic.o: Lic.cpp Lic.h $(AUXSRC) 90 Renderable.o: Renderable.cpp 91 gcc $(CFLAG) Renderable.cpp 92 93 Lic.o: Renderable.o Lic.cpp Lic.h $(AUXSRC) 91 94 gcc $(CFLAG) Lic.cpp 92 95 -
trunk/gui/vizservers/nanovis/ParticleSystem.cpp
r397 r401 203 203 204 204 205 void ParticleSystem::render(){ display_vertices(); } 206 205 207 void ParticleSystem::display_vertices(){ 206 208 glDisable(GL_TEXTURE_2D); -
trunk/gui/vizservers/nanovis/ParticleSystem.h
r397 r401 25 25 #include "global.h" 26 26 27 #include "Renderable.h" 27 28 #include "RenderVertexArray.h" 28 29 #include "Vector3.h" … … 40 41 41 42 42 class ParticleSystem {43 class ParticleSystem : public Renderable{ 43 44 44 45 NVISid psys_fbo[2]; //frame buffer objects: two are defined, flip them as input output every step … … 74 75 void display_vertices(); 75 76 void reset(); 77 void render(); 76 78 77 79 }; -
trunk/gui/vizservers/nanovis/Sphere.cpp
r379 r401 22 22 int _stack, 23 23 int _slice): 24 Renderable(Vector3(x, y, z)), 24 25 radius(_radius), 25 26 stack(_stack), 26 27 slice(_slice), 27 center(Vector3(x,y,z)), 28 color(Color(r,g,b)) 29 { } 28 color(Color(r,g,b)) { } 30 29 30 Sphere::~Sphere(){} 31 32 void Sphere::render(){} 31 33 32 34 void Sphere::draw(GLUquadric* quad){ … … 35 37 glMatrixMode(GL_MODELVIEW); 36 38 glPushMatrix(); 37 glTranslatef( center.x, center.y, center.z);39 glTranslatef(location.x, location.y, location.z); 38 40 39 41 //draw it -
trunk/gui/vizservers/nanovis/Sphere.h
r379 r401 13 13 * ====================================================================== 14 14 */ 15 15 16 #ifndef _SPHERE_H_ 16 17 #define _SPHERE_H_ 17 18 18 19 #include <GL/glut.h> 20 19 21 #include "Color.h" 20 #include " Vector3.h"22 #include "Renderable.h" 21 23 22 class Sphere {24 class Sphere : public Renderable{ 23 25 24 26 public: 25 Vector3 center;26 27 float radius; 27 28 Color color; … … 29 30 int slice; 30 31 31 Sphere(){}; 32 ~Sphere(){}; 32 ~Sphere(); 33 33 Sphere(float x, float y, float z, float r, float g, float b, float _radius, int _stack, int _slice); 34 34 void set_vertical_res(int _stack); … … 37 37 //display the sphere 38 38 void draw(GLUquadric* q); 39 void render(); 39 40 }; 40 41 -
trunk/gui/vizservers/nanovis/nanovis.cpp
r397 r401 1655 1655 draw_3d_axis(); 1656 1656 1657 lic-> display(); //display the line integral convolution result1657 lic->render(); //display the line integral convolution result 1658 1658 1659 1659 //soft_display_verts(); 1660 1660 perf->enable(); 1661 psys-> display_vertices();1661 psys->render(); 1662 1662 perf->disable(); 1663 1663 //fprintf(stderr, "particle pixels: %d\n", perf->get_pixel_count()); -
trunk/gui/vizservers/nanovis/shaders/one_volume.cg
r396 r401 18 18 19 19 20 //#define PHONG_SHADING20 #define PHONG_SHADING 21 21 22 22 PixelOut main(v2f IN, /* uniform sampler1D tf,*/ … … 37 37 #ifdef PHONG_SHADING 38 38 //lighting parameters 39 float3 normal = normalize(sample.yzw); 39 float3 normal; 40 if(length(sample.yzw)>0.0) 41 normal = normalize(sample.yzw); 42 40 43 float3 light_vector = normalize(IN.Light); 41 44 float3 eye_vector = normalize(IN.EyeVector); … … 46 49 //sample the transfer function texture 47 50 float4 color = tex1D(tf, sample.x); 48 color.w = 5*color.w/renderParameters.x;51 color.w = 30*color.w/renderParameters.x; 49 52 50 53 //float4 color = float4(sample.x, 0, 0, 1);
Note: See TracChangeset
for help on using the changeset viewer.