Unformatted text preview:

1Scalar VisualizationMike [email protected] State Universitymjb – April 2, 2013Oregon State UniversityComputer GraphicsIn Visualization, we Use the Concept of a Transfer Functionto set Color as a Function of Scalar ValueColormjb – April 2, 2013Oregon State UniversityComputer GraphicsScalar Value2A Gallery of Color Scale Transfer Function Possibilitiesmjb – April 2, 2013Oregon State UniversityComputer GraphicsGlyphsGlyphs are small symbols that can be placed at the location of data points. In 2D, we often call this a scatterplot. The glyph itself can convey information using properties such as:•Type•Color•Color•Size• Orientation• Transparency• Featuresmjb – April 2, 2013Oregon State UniversityComputer GraphicsThe OpenDX AutoGlyphfunction gives you these typeoptions:3OpenDX Scalar GlyphsDiamondCircleSquareCube Spheremjb – April 2, 2013Oregon State UniversityComputer GraphicsLIGO Gravity Glyphsmjb – April 2, 2013Oregon State UniversityComputer GraphicsCan also use shape to convey data-meaningHitting the secret Easter Egg key 4Using 3D Glyphs is called a Point CloudOrthographic Projection results in the row-of-corn problemPerspective Projection results in the Moiré problemGood for overall patterns -- bad for detailOrthographic Projection results in the row-of-corn problemPerspective Projection results in the Moiré problemmjb – April 2, 2013Oregon State UniversityComputer Graphicsstruct node{A Simple Point Cloud Data Structure{float x, y, z;float s;float r, g, b;};mjb – April 2, 2013Oregon State UniversityComputer Graphicsstruct node Nodes[NX][NY][NZ];5In OpenGL . . .float delx = ( XMAX – XMIN ) / (float)(NX-1);float dely = ( YMAX – YMIN ) / (float)(NY-1);float delz = ( ZMAX – ZMIN ) / (float)(NZ-1);glPointSize( 2. );glBegin( GL_POINTS );fl t XMINNX = 4 means that we have 3 gapsfloat x = XMIN;for( int i=0; i < NX; i++, x += delx ){ float y = YMIN;for( int j=0; j < NY; j++, y += dely ){ float z = ZMIN;for( int k=0; k < NZ; k++, z += delz ){ float scalar = Nodes[i][j][k].s;float r = ???;mjb – April 2, 2013Oregon State UniversityComputer Graphicsfloat g = ???;float b = ???;glColor3f( r, g, b );glVertex3f( x, y, z );} } } glEnd( );Computing x, y, and zNote that x, y, and z can be computed at each node point by just keeping track of them and incrementing them each time through their respective loop, as shown on the previous page. They can also be computed from the loop index like this:NX-1 1.i0x-1.0(1.)( 1) 0 1( 1)ixNX mjb – April 2, 2013Oregon State UniversityComputer Graphicsfloat x = -1. + 2. * (float)i / (float)(NX-1);float y = -1. + 2. * (float)j / (float)(NY-1);float z = -1. + 2. * (float)k / (float)(NZ-1);(1)01.(1.)NX 6Jitter Gives a Better Point Cloud DisplayOrthographic ProjectionPerspective ProjectionOrthographic ProjectionPerspective Projectionmjb – April 2, 2013Oregon State UniversityComputer GraphicsPoint Cloud Culling Using Range SlidersLow values culledmjb – April 2, 2013Oregon State UniversityComputer GraphicsFull data7#define S 0const char *SFORMAT = { "S: %.3f - %.3f" };float SLowHigh[2];GLUI_StaticText *SLabel;Using Range Slidersslider = Glui->add_slider( true, GLUI_HSLIDER_FLOAT, SLowHigh, S, (GLUI_Update_CB) Sliders );slider->set_float_limits( SLowHigh[0], SLowHigh[1] );slider->set_slider_val( SLowHigh[0], SLowHigh[1] );slider->set_w( SLIDERWIDTH );sprintf( str, SFORMAT, SLowHigh[0], SLowHigh[1] );SLabel = Glui->add_statictext_to_panel( rollout, str );voidSlid (iid )mjb – April 2, 2013Oregon State UniversityComputer GraphicsSliders( intid ){char str[256];switch( id ){case S:sprintf( str, SFORMAT, SLowHigh[0], SLowHigh[1] );SLabel->set_text( str );break;Drawing the Range Slider-Filtered Point Cloudfloat x = XMIN;for( int i=0; i < NX; i++, x += delx ){ if( x < XLowHigh[0] || x > XLowHigh[1] )continue; float y = YMIN;for( intj=0; j < NY; j++, y += dely)(j;j ;j,yy){ if( y < YLowHigh[0] || y > YLowHigh[1] )continue; float z = ZMIN;for( int k=0; k < NZ; k++, z += delz ){ if( z < ZLowHigh[0] || z > ZLowHigh[1] )continue; if( Nodes[i][j][k].s < SLowHigh[0] || Nodes[i][j][k].s > SLowHigh[1] )continue;mjb – April 2, 2013Oregon State UniversityComputer Graphicscontinue; . . .glColor3f( r, g, b );glVertex3f( x, y, z);} } } glEnd( );8Enhanced Point Clouds•Color• Alpha• Pointsizemjb – April 2, 2013Oregon State UniversityComputer GraphicsPoint Clouds are nice, but they only tell us about the gross patterns.We want more detail !mjb – April 2, 2013Oregon State UniversityComputer Graphics9Here’s the situation: we have a 2D grid of data points. At each node, we have an X, Y, Z, and a scalar value S. We know Smin, Smax, and the Transfer Function.2D Interpolated Color PlotsUmjb – April 2, 2013Oregon State UniversityComputer GraphicsEven though this is a 2D technique, we keep around the X, Y, and Z coordinates so that the grid doesn’t have to lie in any particular plane.T2D Interpolated Color PlotsWe deal with one square of the mesh at a time:XYZSXYZSX3, Y3, Z3, S3X2, Y2, Z2, S2mjb – April 2, 2013Oregon State UniversityComputer GraphicsX0, Y0, Z0, S0X1, Y1, Z1, S1102D Interpolated Color PlotsWithin that one square, we let OpenGL do the color interpolation for usvoidvoidColorSquare( . . .){Compute an r, g, b for S0glColor3f( r, g, b );glVertex3f( X0, Y0, Z0);Compute an r, g, b for S1glColor3f( r, g, b );glVertex3f( X1, Y1, Z1);CbfSUse the Transfer Functionmjb – April 2, 2013Oregon State UniversityComputer GraphicsCompute an r, g, b for S3glColor3f( r, g, b );glVertex3f( X3, Y3, Z3);Compute an r, g, b for S2glColor3f( r, g, b );glVertex3f( X2, Y2, Z2);}Note the order: 0-1-3-2 !2D Interpolated Color PlotsThen we loop through all squares:glShadeModel( GL_SMOOTH );lB i( GL QUADS )glBegin( GL_QUADS );for( int i = 0; i < numT - 1; i++ ){for( int j = 0; j < numU-1; j++ ){ColorSquare( i, j, … );}}glEnd( );mjb – April 2, 2013Oregon State UniversityComputer Graphics112D Contour LinesHere’s the situation: we have a 2D grid of data points. At each node, we have an X, Y, Z, and a scalar value S. We know the Transfer Function. We also have a particular scalar value, S*, at which we want to draw the contour line(s).()Umjb – April 2,


View Full Document

OSU CS 533 - Scalar Visualization

Download Scalar Visualization
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Scalar Visualization and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Scalar Visualization 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?