From 02c8b1e0c3ed1365a2b6e6a88166034a4f04b279 Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 11 Oct 2005 14:21:44 +0000 Subject: [PATCH] Minor changes --- src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 41 +++++++++++++++---- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index 91f7c70d..471485cd 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -776,6 +776,26 @@ void VISU_OpenGLPointSpriteMapper::DrawPoints(int idx, if( this->UsePointSprites ) this->InitPointSprites( ren, act ); + /* + cout << "XSIZE : " << ren->GetRenderWindow()->GetSize()[0] << endl; + cout << "YSIZE : " << ren->GetRenderWindow()->GetSize()[1] << endl; + + float p1[3], p2[3]; + + ren->SetViewPoint( 0.0, 0.0, 0.0 ); + ren->ViewToDisplay(); + ren->GetDisplayPoint( p1 ); + + ren->SetViewPoint( 1.0, 1.0, 1.0 ); + ren->ViewToDisplay(); + ren->GetDisplayPoint( p2 ); + + cout << p1[0] << " " << p1[1] << " " << p1[2] << endl; + cout << p2[0] << " " << p2[1] << " " << p2[2] << endl; + + float d = pow( pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ), 0.5 ); + cout << "ZOOM : " << d / pow( 2, 0.5 ) << endl; + */ glPointSize( this->DefaultPointSize ); @@ -814,23 +834,26 @@ void VISU_OpenGLPointSpriteMapper::DrawPoints(int idx, aVertex[i].vy = p->GetPoint( pts[0] )[1]; aVertex[i].vz = p->GetPoint( pts[0] )[2]; + float red, green, blue; if( colors && this->PointSpriteResults ) { unsigned char *col = colors->GetPointer(pts[0]<< 2); - aVertex[i].r = ( ( int )col[0] ) / 255.0; - aVertex[i].g = ( ( int )col[1] ) / 255.0; - aVertex[i].b = ( ( int )col[2] ) / 255.0; + red = ( ( int )col[0] ) / 255.0; + green = ( ( int )col[1] ) / 255.0; + blue = ( ( int )col[2] ) / 255.0; } else { - aVertex[i].r = aPropertyColorRed; - aVertex[i].g = aPropertyColorGreen; - aVertex[i].b = aPropertyColorBlue; + red = aPropertyColorRed; + green = aPropertyColorGreen; + blue = aPropertyColorBlue; } - aVertex[i].hue = ComputeHue( ( int )( aVertex[i].r * 255 ), - ( int )( aVertex[i].g * 255 ), - ( int )( aVertex[i].b * 255 ) ); + aVertex[i].r = red; + aVertex[i].g = green; + aVertex[i].b = blue; + + aVertex[i].hue = ComputeHue( ( int )( red * 255 ), ( int )( green * 255 ), ( int )( blue * 255 ) ); } GLuint aBufferObjectID = 0; -- 2.39.2