Changeset 373 for trunk/gui/vizservers
- Timestamp:
- Mar 23, 2006, 8:28:56 AM (19 years ago)
- Location:
- trunk/gui/vizservers/nanovis
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/vizservers/nanovis/Color.h
r371 r373 16 16 #define _COLOR_H_ 17 17 18 #include "Vector4.h"19 20 18 class Color 21 19 { -
trunk/gui/vizservers/nanovis/Makefile
r366 r373 1 1 OBJ_NANOVIS = nanovis.o Socket.o RenderVertexArray.o Plane.o ConvexPolygon.o Vector4.o Vector3.o Mat4x4.o \ 2 Texture1D.o Texture3D.o ColorMap.o Volume.o Texture2D.o ParticleSystem.o 2 Texture1D.o Texture3D.o ColorMap.o Volume.o Texture2D.o ParticleSystem.o Sphere.o Color.o 3 3 4 4 AUXSRC = config.h define.h global.h … … 7 7 SORTSRC = ./sort 8 8 9 LIB_NANOVIS = -ltcl8.4 -lGL -lglut -lGLEW -lCg -lCgGL -pthread 9 LIB_NANOVIS = -ltcl8.4 -lGL -lglut -lGLEW -lCg -lCgGL -pthread -lstdc++ 10 10 LIB_CLIENT = -lGL -lglut -pthread 11 CFLAG = -g -c -Wall -I../ ../../src2/core11 CFLAG = -g -c -Wall -I../src2/core 12 12 13 13 all: nanovis … … 17 17 18 18 nanovis: $(OBJ_NANOVIS) 19 gcc -g -o nanovis $(OBJ_NANOVIS) $(LIB_NANOVIS) ../ ../../src2/core/*.o19 gcc -g -o nanovis $(OBJ_NANOVIS) $(LIB_NANOVIS) ../src2/core/*.o 20 20 21 21 Socket.o: $(SOCKETSRC)/Socket.h $(SOCKETSRC)/Socket.cpp … … 27 27 #qdclient: $(OBJ_CLIENT) 28 28 # gcc -g -o qdclient $(OBJ_CLIENT) $(LIB_CLIENT) 29 30 Color.o: Color.cpp 31 gcc $(CFLAG) Color.cpp 32 33 Sphere.o: Vector3.o Color.o 34 gcc $(CFLAG) Sphere.cpp 29 35 30 36 ColorMap.o: ColorMap.cpp -
trunk/gui/vizservers/nanovis/Sphere.cpp
r371 r373 16 16 #include "Sphere.h" 17 17 #include <stdio.h> 18 #include <GL/glut.h>19 18 20 19 Sphere::Sphere(float x, float y, float z, … … 23 22 int _stack, 24 23 int _slice): 25 center(Vector3(x,y,z)),26 color(Color(r,g,b,a)),27 24 radius(_radius), 28 25 stack(_stack), 29 slice(_slice) 26 slice(_slice), 27 center(Vector3(x,y,z)), 28 color(Color(r,g,b,a)) 30 29 { } 31 30 32 31 33 Sphere::draw(GLUquadric* quad){32 void Sphere::draw(GLUquadric* quad){ 34 33 glColor4f(color.r, color.g, color.b, color.a); 35 34 36 35 glMatrixMode(GL_MODELVIEW); 37 36 glPushMatrix(); 38 glTranslate (center.x, center.y, center.z);37 glTranslatef(center.x, center.y, center.z); 39 38 40 39 //draw it … … 43 42 } 44 43 45 Sphere::set_horizontal_res(int _slice):slice(_slice){}46 Sphere::set_vertical_res(int _stack):stack(_stack){}44 void Sphere::set_horizontal_res(int _slice) {slice=_slice;} 45 void Sphere::set_vertical_res(int _stack) {stack=_stack;} 47 46 -
trunk/gui/vizservers/nanovis/Sphere.h
r371 r373 16 16 #define _SPHERE_H_ 17 17 18 #include <GL/glut.h> 18 19 #include "Color.h" 20 #include "Vector3.h" 19 21 20 22 class Sphere{ … … 30 32 ~Sphere(){}; 31 33 Sphere(float x, float y, float z, float r, float g, float b, float a, float r, int _stack, int _slice); 32 set_vertical_res(int _stack);33 set_horizontal_res(int _slice);34 void set_vertical_res(int _stack); 35 void set_horizontal_res(int _slice); 34 36 35 37 //display the sphere 36 draw();38 void draw(GLUquadric* q); 37 39 }; 38 40 -
trunk/gui/vizservers/nanovis/Volume.cpp
r371 r373 17 17 18 18 19 Volume::Volume( int x, int y, int z,19 Volume::Volume(float x, float y, float z, 20 20 int w, int h, int d, 21 21 NVISdatatype t, NVISinterptype interp, int n, float* data): -
trunk/gui/vizservers/nanovis/nanovis.cpp
r372 r373 273 273 274 274 nx = (int)ceil(dx/dmin); 275 ny = (int)ceil(dy/dmin); 276 nz = (int)ceil(dz/dmin); 277 278 #ifndef NV40 275 279 nx = pow(2.0, ceil(log10((double)nx)/log10(2.0))); // must be an even power of 2 276 ny = (int)ceil(dy/dmin);277 280 ny = pow(2.0, ceil(log10((double)ny)/log10(2.0))); 278 nz = (int)ceil(dz/dmin);279 281 nz = pow(2.0, ceil(log10((double)nz)/log10(2.0))); 282 #endif 283 280 284 float *data = new float[4*nx*ny*nz]; 281 285 … … 385 389 } 386 390 387 volume[index] = new Volume( width, height, depth, NVIS_FLOAT, NVIS_LINEAR_INTERP, n_component, data);391 volume[index] = new Volume(0., 0., 0., width, height, depth, NVIS_FLOAT, NVIS_LINEAR_INTERP, n_component, data); 388 392 assert(volume[index]!=0); 389 393 } … … 1395 1399 */ 1396 1400 1401 /* 1397 1402 glBegin(GL_QUADS); 1398 /*1399 glTexCoord2f(0, 0); glVertex3f(-1, -1, slice_z);1400 glTexCoord2f(1, 0); glVertex3f(1, -1, slice_z);1401 glTexCoord2f(1, 1); glVertex3f(1, 1, slice_z);1402 glTexCoord2f(0, 1); glVertex3f(-1, 1, slice_z);1403 */1404 1403 glTexCoord2f(0, 0); glVertex3f(0, 0, slice_z); 1405 1404 glTexCoord2f(1, 0); glVertex3f(1, 0, slice_z); … … 1407 1406 glTexCoord2f(0, 1); glVertex3f(0, 1, slice_z); 1408 1407 glEnd(); 1408 */ 1409 1409 1410 1410 //soft_display_verts(); -
trunk/gui/vizservers/nanovis/nanovis.h
r273 r373 107 107 float tmax = NPIX/(SCALE*NPN); 108 108 float dmax = SCALE/NPIX; 109 110 111 //currently active shader 112 int cur_shader = 0; -
trunk/gui/vizservers/nanovis/shaders/one_volume.cg
r372 r373 27 27 //float3 sample = tex3D(volume, tex_coord.xyz).xyz; 28 28 float sample = tex3D(volume, tex_coord.xyz); 29 //float sample = 1;30 29 31 //OUT.Color = float4(sample, 10*sqrt(sample.x*sample.x + sample.y*sample.y + sample.z*sample.z)/renderParameters.x);32 30 if (sample < 0.) { 33 31 OUT.Color = float4(0.0, 0.0, 0.0, 0.0); 34 32 } else { 35 OUT.Color = float4(sample, sample, sample, sample *0.1);33 OUT.Color = float4(sample, sample, sample, sample/renderParameters.x); 36 34 } 35 37 36 return OUT; 38 37 }
Note: See TracChangeset
for help on using the changeset viewer.