Changeset 1333 for trunk/packages
- Timestamp:
- Mar 16, 2009 2:05:56 PM (15 years ago)
- Location:
- trunk/packages/vizservers/nanovis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/NvParticleRenderer.cpp
r1331 r1333 102 102 103 103 _advectionShader = new NvParticleAdvectionShader(); 104 105 104 } 106 105 … … 268 267 } 269 268 269 void NvParticleRenderer::draw_bounding_box( 270 float x0, float y0, float z0, 271 float x1, float y1, float z1, 272 float r, float g, float b, 273 float line_width) 274 { 275 glPushMatrix(); 276 glEnable(GL_DEPTH_TEST); 277 glDisable(GL_TEXTURE_2D); 278 glEnable(GL_BLEND); 279 280 glColor4d(r, g, b, 1.0); 281 glLineWidth(line_width); 282 283 glBegin(GL_LINE_LOOP); 284 { 285 glVertex3d(x0, y0, z0); 286 glVertex3d(x1, y0, z0); 287 glVertex3d(x1, y1, z0); 288 glVertex3d(x0, y1, z0); 289 } 290 glEnd(); 291 292 glBegin(GL_LINE_LOOP); 293 { 294 glVertex3d(x0, y0, z1); 295 glVertex3d(x1, y0, z1); 296 glVertex3d(x1, y1, z1); 297 glVertex3d(x0, y1, z1); 298 } 299 glEnd(); 300 301 302 glBegin(GL_LINE_LOOP); 303 { 304 glVertex3d(x0, y0, z0); 305 glVertex3d(x0, y0, z1); 306 glVertex3d(x0, y1, z1); 307 glVertex3d(x0, y1, z0); 308 } 309 glEnd(); 310 311 glBegin(GL_LINE_LOOP); 312 { 313 glVertex3d(x1, y0, z0); 314 glVertex3d(x1, y0, z1); 315 glVertex3d(x1, y1, z1); 316 glVertex3d(x1, y1, z0); 317 } 318 glEnd(); 319 320 glPopMatrix(); 321 glDisable(GL_DEPTH_TEST); 322 glDisable(GL_BLEND); 323 glEnable(GL_TEXTURE_2D); 324 } 325 270 326 void NvParticleRenderer::display_vertices() 271 327 { … … 276 332 glEnable(GL_COLOR_MATERIAL); 277 333 334 glPushMatrix(); 335 336 glTranslatef(origin.x, origin.y, origin.z); 337 glScaled(scale.x, scale.y, scale.z); 338 339 // TBD... 340 /* 341 draw_bounding_box( 342 0, 0, 0, 343 1, 1, 1, 344 1, 1, 1, 2); 345 346 draw_bounding_box( 347 0, 0.5f / 4.5f, 0.5f / 4.5, 348 1, 4.0f / 4.5f, 4.0f / 4.5, 349 1, 0, 0, 2); 350 351 draw_bounding_box( 352 1/3.0f, 1.0f / 4.5f, 0.5f / 4.5, 353 2/3.0f, 3.5f / 4.5f, 3.5f / 4.5, 354 1, 1, 0, 2); 355 */ 356 278 357 glPointSize(1.2); 279 358 glColor4f(.2,.2,.8,1.); 280 281 glPushMatrix();282 283 glTranslatef(origin.x, origin.y, origin.z);284 glScaled(scale.x, scale.y, scale.z);285 286 359 glEnableClientState(GL_VERTEX_ARRAY); 287 360 m_vertex_array->SetPointer(0); -
trunk/packages/vizservers/nanovis/NvParticleRenderer.h
r1331 r1333 29 29 #include "Vector3.h" 30 30 31 #include <vector> 32 31 33 #include "NvParticleAdvectionShader.h" 32 34 … … 42 44 }; 43 45 46 struct ParticleInitSlice { 47 int slice_id; 48 int slice_axis; 49 float slice_pos; 50 bool enabled; 51 }; 44 52 45 53 class NvParticleRenderer : public Renderable { … … 89 97 NvParticleAdvectionShader* _advectionShader; 90 98 99 std::vector<ParticleInitSlice> _initSliceArray; 100 91 101 /** 92 102 * @brief scale of flow data … … 97 107 98 108 bool _activate; 109 99 110 public: 100 111 int psys_width; //the storage of particles is implemented as a 2D array. … … 114 125 void deactivate(); 115 126 bool isActivated() const; 127 128 void draw_bounding_box(float x0, float y0, float z0, float x1, float y1, float z1, float r, float g, float b, float line_width); 116 129 }; 117 130
Note: See TracChangeset
for help on using the changeset viewer.