DOC PREVIEW
OSU CS 553 - Scalar Visualization

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Scalar VisualizationMike [email protected] – April 2, 2013Oregon State UniversityComputer GraphicsOregon State UniversityIn Visualization, we Use the Concept of a Transfer Functionto set Color as a Function of Scalar ValueColormjb – April 2, 2013Oregon State UniversityComputer GraphicsScalar ValueCA 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•Size• Orientation• Transparency• Featuresmjb – April 2, 2013Oregon State UniversityComputer GraphicsThe OpenDX AutoGlyphfunction gives you these typeoptions:OpenDX Scalar GlyphsDiamondCircleSquaremjb – April 2, 2013Oregon State UniversityComputer GraphicsCube SphereLIGO Gravity Glyphsmjb – April 2, 2013Oregon State UniversityComputer GraphicsCan also use shape to convey data-meaningHitting the secret Easter Egg key 2Using 3D Glyphs is called a Point CloudOrthographic Projection results in the row-of-corn problem Perspective Projection results in the Moiré problemGood for overall patterns -- bad for detailmjb – April 2, 2013Oregon State UniversityComputer Graphicsstruct node{float x, y, z;float s;float r g b;A Simple Point Cloud Data Structuremjb – April 2, 2013Oregon State UniversityComputer Graphicsfloat r, g, b;};struct node Nodes[NX][NY][NZ];In 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 );float x = XMIN;for( int i=0; i < NX; i++, x += delx ){ float y = YMIN;for( int j=0; j < NY; j++, y += dely ){NX = 4 means that we have 3 gapsmjb – April 2, 2013Oregon State UniversityComputer Graphics{ float z = ZMIN;for( int k=0; k < NZ; k++, z += delz ){ float scalar = Nodes[i][j][k].s;float r = ???;float 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:iNX-1x1.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);0 -1.0(1.)(1)01.(1.)ixNX Jitter Gives a Better Point Cloud DisplayOrthographic Projection Perspective Projectionmjb – April 2, 2013Oregon State UniversityComputer GraphicsPoint Cloud Culling Using Range SlidersLow values culledmjb – April 2, 2013Oregon State UniversityComputer GraphicsFull data3slider = 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 );#define S 0const char *SFORMAT = { "S: %.3f - %.3f" };float SLowHigh[2];GLUI_StaticText *SLabel;Using Range Slidersmjb – April 2, 2013Oregon State UniversityComputer Graphicssprintf( str, SFORMAT, SLowHigh[0], SLowHigh[1] );SLabel = Glui->add_statictext_to_panel( rollout, str );voidSliders( int id ){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( int j=0; j < NY; j++, y += dely ){ if( y < YLowHigh[0] || y > YLowHigh[1] )continue; float z = ZMIN;for(intk=0; k < NZ; k++ z +=delz)mjb – April 2, 2013Oregon State UniversityComputer Graphicsfor( intk=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; . . .glColor3f( r, g, b );glVertex3f( x, y, z);} } } glEnd( );Enhanced 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 GraphicsHere’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:X3, Y3, Z3, S3X2, Y2, Z2, S2mjb – April 2, 2013Oregon State UniversityComputer GraphicsX0, Y0, Z0, S0X1, Y1, Z1, S142D Interpolated Color PlotsWithin that one square, we let OpenGL do the color interpolation for usvoidColorSquare( . . .){Compute an r, g, b for S0glColor3f( r, g, b );glVertex3f( X0, Y0, Z0);Use the Transfer Functionmjb – April 2, 2013Oregon State UniversityComputer Graphicsg(0,0,0);Compute an r, g, b for S1glColor3f( r, g, b );glVertex3f( X1, Y1, Z1);Compute 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 );glBegin( GL_QUADS );for( int i = 0; i < numT - 1; i++ ){for( int j = 0; j < numU-1; j++ ){ColorSquare(ij);mjb – April 2, 2013Oregon State UniversityComputer GraphicsColorSquare( i, j, … );}}glEnd( );2D 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, 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


View Full Document

OSU CS 553 - 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?