Assignment #4: Scalar Field Visualization 3D: Cutting Plane, Wireframe Iso-surfacing

Similar documents
Assignment #3: Scalar Field Visualization 3D: Cutting Plane, Wireframe Iso-surfacing, and Direct Volume Rendering

Scalar Visualization

Scalar Visualization. In Visualization, we Use the Concept of a Transfer Function to set Color as a Function of Scalar Value.

Assignment #5: Scalar Field Visualization 3D: Direct Volume Rendering

CSCE 110 Dr. Amr Goneid Exercise Sheet (6): Exercises on Structs and Dynamic Lists

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

13.1. Functions of Several Variables. Introduction to Functions of Several Variables. Functions of Several Variables. Objectives. Example 1 Solution

Curves, Tangent Planes, and Differentials ( ) Feb. 26, 2012 (Sun) Lecture 9. Partial Derivatives: Signs on Level Curves, Tangent

Assignment #3: 2D Scalar Field Visualization II: Iso-contouring

Scalar Field Visualization. Some slices used by Prof. Mike Bailey

Math 113 Calculus III Final Exam Practice Problems Spring 2003

PASS Sample Size Software

Appendix III NSLC Extensions

Vector Fields: Intro, Div, Curl

Three-Dimensional Coordinate Systems

Chapter 24. Creating Surfaces for Displaying and Reporting Data

(c) 0 (d) (a) 27 (b) (e) x 2 3x2

6. Find the equation of the plane that passes through the point (-1,2,1) and contains the line x = y = z.

f xx (x, y) = 6 + 6x f xy (x, y) = 0 f yy (x, y) = y In general, the quantity that we re interested in is

Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers

QUIZ 4 (CHAPTER 17) SOLUTIONS MATH 252 FALL 2008 KUNIYUKI SCORED OUT OF 125 POINTS MULTIPLIED BY % POSSIBLE

Math 209, Fall 2009 Homework 3

Chapter 5 Partial Differentiation

16. LECTURE 16. I understand how to find the rate of change in any direction. I understand in what direction the maximum rate of change happens.

If the center of the sphere is the origin the the equation is. x y z 2ux 2vy 2wz d 0 -(2)

Functions of Several Variables

High Performance Computing: Tools and Applications

What you will learn today

Marching Squares Algorithm. Can you summarize the marching squares algorithm based on what we just discussed?

Rectangular Coordinates in Space

Math Exam III Review

Lorene initial data for binary neutron stars

MAT203 OVERVIEW OF CONTENTS AND SAMPLE PROBLEMS

Directional Derivatives. Directional Derivatives. Directional Derivatives. Directional Derivatives. Directional Derivatives. Directional Derivatives

You may know these...

3.6 Directional Derivatives and the Gradient Vector

Math 2130 Practice Problems Sec Name. Change the Cartesian integral to an equivalent polar integral, and then evaluate.

14.6 Directional Derivatives and the Gradient Vector

Surfaces and Partial Derivatives

Multivariate Calculus Review Problems for Examination Two

Engineering Mathematics (4)

Building Geometries in Data Arrays

Chapter 15 Vector Calculus

the remaiis c p i j fi r a lent'tli of time, can havetspeclii and case any affi :er shall refuse" or neglect <to «J3,b.01Jllis p. m.

. Tutorial Class V 3-10/10/2012 First Order Partial Derivatives;...

Vector Calculus: Understanding the Cross Product

Practice problems from old exams for math 233 William H. Meeks III December 21, 2009

302 CHAPTER 3. FUNCTIONS OF SEVERAL VARIABLES. 4. Function of several variables, their domain. 6. Limit of a function of several variables

Math 213 Calculus III Practice Exam 2 Solutions Fall 2002

Math 21a Tangent Lines and Planes Fall, What do we know about the gradient f? Tangent Lines to Curves in the Plane.

Multivariate Calculus: Review Problems for Examination Two

Contents. MATH 32B-2 (18W) (L) G. Liu / (TA) A. Zhou Calculus of Several Variables. 1 Homework 1 - Solutions 3. 2 Homework 2 - Solutions 13

Lecture 8: Fitting. Tuesday, Sept 25

1.5 Equations of Lines and Planes in 3-D

Topic 2b Building Geometries into Data Arrays

Equation of tangent plane: for implicitly defined surfaces section 12.9

AGDC Per-Pixel Shading. Sim Dietrich

Surfaces and Partial Derivatives

Agenda. The main body and cout. Fundamental data types. Declarations and definitions. Control structures

MATH 234. Excercises on Integration in Several Variables. I. Double Integrals

Section 13.5: Equations of Lines and Planes. 1 Objectives. 2 Assignments. 3 Lecture Notes

Saturn User Manual. Rubén Cárdenes. 29th January 2010 Image Processing Laboratory, University of Valladolid. Abstract

Chapter 8: Implementation- Clipping and Rasterization

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

Assignment 2 Ray Tracing

Geometric Modeling in Graphics

Solution Notes. COMP 151: Terms Test

Finite Element Analysis Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology Madras. Module - 01 Lecture - 15

f for Directional Derivatives and Gradient The gradient vector is calculated using partial derivatives of the function f(x,y).

a. Plot the point (x, y, z) and understand it as a vertex of a rectangular prism. c. Recognize and understand equations of planes and spheres.

The 2D/3D Differential Optical Flow

REVIEW I MATH 254 Calculus IV. Exam I (Friday, April 29) will cover sections

3.3 Optimizing Functions of Several Variables 3.4 Lagrange Multipliers

The Level Set Method. Lecture Notes, MIT J / 2.097J / 6.339J Numerical Methods for Partial Differential Equations

Lesson 19: The Graph of a Linear Equation in Two Variables Is a Line

Directional Derivatives and the Gradient Vector Part 2

Lecture 9: Hough Transform and Thresholding base Segmentation

There are 10 problems, with a total of 150 points possible. (a) Find the tangent plane to the surface S at the point ( 2, 1, 2).

MATH Harrell. Which way is up? Lecture 9. Copyright 2008 by Evans M. Harrell II.

Physical Modeling and Surface Detection. CS116B Chris Pollett Mar. 14, 2005.

Isosurface Rendering. CSC 7443: Scientific Information Visualization

Volume by Slicing (Disks & Washers)

Recursion. Data and File Structures Laboratory. DFS Lab (ISI) Recursion 1 / 20

MATH. 2153, Spring 16, MWF 12:40 p.m. QUIZ 1 January 25, 2016 PRINT NAME A. Derdzinski Show all work. No calculators. The problem is worth 10 points.

Introduction to PDEs: Notation, Terminology and Key Concepts

3D Data visualization with Mayavi and TVTK

Math 690N - Final Report

Computer Science 426 Midterm 3/11/04, 1:30PM-2:50PM

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette

Section 2.5. Functions and Surfaces

In-plane principal stress output in DIANA

Post-Processing Static Results of a Space Satellite

12 Steps to a Fast Multipole. Method on GPUs. Method on GPUs. 12 Steps to a Fast Multipole. Rio Yokota Boston University. Friday, January 7, 2011

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

Functions of Several Variables

Chapter 15 Notes, Stewart 7e

CS 432 Interactive Computer Graphics

MEFT / Quantum Optics and Lasers. Suggested problems from Fundamentals of Photonics Set 1 Gonçalo Figueira

[Anton, pp , pp ] & [Bourne, pp ]

18.02 Final Exam. y = 0

Transcription:

Goals: Assignment #4: Scalar Field Visualization 3D: Cutting Plane, Wireframe Iso-surfacing Due Sept. 28, before midnight With the results from your assignments #2 and #3, the first goal of this assignment is to get familiar with the slicing technique in 3D volumetric data visualization. You will need to design an interface to allow the volume slicing along the X, Y and Z axis directions, respectively. The second goal is to perform a simple iso-surfacing like visualization technique which is a natural extension of the 2D iso-contouring. All the visualization in this assignment will re-use the coloring schemes that you have implemented in Assignment #2, and extend the interface you developed in the past two assignments. Tasks: 1. Data generation (10 points) The function you are going to use is where rr ii 2 = (xx XX ii ) 2 + (yy YY ii ) 2 + (zz ZZ ii ) 2 and 3 tt(xx, yy, zz) = AA ii ee 5rr ii 2 ii=0 i Xi Yi Zi Ai 0 1.00 0.00 0.00 90.00 1-1.00 0.30 0.00 120.00 2 0.00 1.00 0.00 120.00 3 0.00 0.40 1.00 170.00 You are given the temperature data from the simulation at each node in a 3D uniform grid. The coordinate range of the data volume is: -1.0 x,y,z 1.0. The number of node points you place along each dimension is at least 50 but may also be adjustable by the user. const int NX = 50; // Note: you can have an interface to change the data dimension const int NY = 50; const int NZ = 50; For the temperature range of the data, use: 0.0 t 100.0. The temperatures defined by the equation actually go higher than 100 degrees in places, but don't worry about it. After computing t, just clamp it to 100.: 1

const float TEMPMIN = 0.f ; const float TEMPMAX = 100.f ; if( t > TEMPMAX ) t = TEMPMAX; Please refer to the later Suggestions for a suggested data structure to store the information on the individual nodes. You will need to create a 3D array to store this synthetic 3D temperature field. node grid_3d[nx][ny][nz]; 2. Volume slicing and exploration (50 points) Use four sliders to allow the user to cull the data by displaying a subset in X, Y, Z, and Temperature (i.e., showing slices). See the right figure for a demonstration. You will need to prepare three orthogonal cutting planes that are parallel to the XY, YZ, and XZ planes, respectively. Use three checkboxes to enable the user to toggle on or off certain cutting planes. You need to compute the 2D scalar values on each plane and make a color plot for each plane using the color scales you have implemented in Assignment#2. The user should be able to move the respective cutting planes along the corresponding axes (see the right figures for an example using the GLUI interface) Hint: You can organize the 3D grid points into the respective XY, YZ, and XZ planes so that the user can choose which XY, YZ and/or XZ planes to display. Use a fifth slider to control the display based on the magnitude of the gradient at each point. The gradient at each point is a 3-component vector: dddd dddd magnitude of the gradient is computed as, dddd dddd, dddd dddd. The ( dddd dddd )2 + ( dddd dddd )2 + ( dddd dddd )2. This will show where the scalar value is changing quickly and where it is changing slowly. The x gradient at a point is obtained by taking the difference from the point before to the point after. This is called a twosided gradient (or central difference) computation: Nodes[i][j][k].dTdx = ( Nodes[i+1][j][k].T - Nodes[i-1][j][k].T ) / ( Nodes[i+1][j][k].x - Nodes[i-1][j][k].x ); The y and z gradients are similarly computed. Be sure to take into account when i, j, or k are either 0 or at their maximum value (i.e., those boundary vertices). This is when you would use a one-sided gradient computation. 2

3. Wireframe Iso-surfacing (40 points) Implement the wireframe iso-surfacing technique as introduced in the class (slides 18-19 in lecture 6_2). This should be done based on the iso-contours computed on those volume slices that are parallel to the XY, YZ, and XZ planes, respectively. Make sure you implement an efficient iso-contouring algorithm in Assignment #3. Grades: Tasks Total points 1 10 2 50 3 40 Suggestions Here are some suggestions that you may find helpful for this assignment. The following code can be used to compute the scalar fields defined on the 3D grids. However, you can always develop your own code. struct sources double xc, yc, zc; // double a; // temperature value of the source Sources[] = 1.00f, 0.00f, 0.00f, 90.00f, -1.00f, -0.30f, 0.00f, 120.00f, 0.10f, 1.00f, 0.00f, 120.00f, 0.00f, 0.40f, 1.00f, 170.00f, ; // The following function is going to be used for the next assignment as well double Temperature( double x, double y, double z ) double t = 0.0; for( int i = 0; i < 4; i++ ) double dx = x - Sources[i].xc; double dy = y - Sources[i].yc; double dz = z - Sources[i].zc; double rsqd = dx*dx + dy*dy + dz*dz; t += Sources[i].a * exp( -5.*rsqd ); if( t > TEMPMAX ) 3

t = TEMPMAX; return t; You can use the following data structure to store your 2D and 3D scalar fields defined at the regular grids. struct node float x, y, z; float T; float r, g, b; float rad; float dtdx, dtdy, dtdz; float grad; ; // location // temperature // the assigned color // radius // can store these if you want, or not // total gradient Using the GLUI Range Sliders We have added range sliders to the GLUI library. Here is how to use them. For each variable, define a text-display format, a 2-element array to hold the low and high end of the range, a pointer to the created slider, and a pointer to the created text-display: // in the global variables: #define TEMP 0 const float TEMPMIN = 0. ; const float TEMPMAX = 100. ; const char * TEMPFORMAT = "Temperature: %5.2f - %5.2f" ; float TempLowHigh[2]; GLUI_HSlider * GLUI_StaticText * TempSlider; TempLabel; 4

// in the function prototypes: void Buttons( int ); void Sliders( int ); // in InitGlui( ): char str[128]; TempSlider = Glui->add_slider( true, GLUI_HSLIDER_FLOAT, TempLowHigh, TEMP, (GLUI_Update_CB) Sliders ); TempSlider->set_float_limits( TEMPMIN, TEMPMAX ); TempSlider->set_w( 200 ); // good slider width sprintf( str, TEMPFORMAT, TempLowHigh[0], TempLowHigh[1] ); TempLabel = Glui->add_statictext( str ); The arguments to Glui->add_slider( ) are, in order: range_slider true means this is a 2-edged range slider type Use GLUI_HSLIDER_FLOAT array 2-element float array to store values in id unique id to be passed into the callback routine (0, 1, 2,...) callback callback routine to call when a slider is used The arguments to TempSlider->set_float_limits( ) are the minimum and maximum values on that slider. The argument to TempSlider->set_w( ) is the width, in pixels, of that slider in the GLUI window. 200 is a good number. The argument to Glui->add_statictext( ) is the text string to display. 5

The Button Callback Routine The buttons callback routine needs to be modified do re-do all the text strings if the Reset button is selected: void Buttons( int id ) char str[256]; switch( id ) case RESET: Reset( ); sprintf( str, TEMPFORMAT, TempLowHigh[0], TempLowHigh[1] ); TempLabel->set_text( str ); The Slider Callback Routine All range sliders can use the same callback routine: void Sliders( int id ) char str[32]; switch( id ) case TEMP: 6

sprintf( str, TEMPFORMAT, TempLowHigh[0], TempLowHigh[1] ); TempLabel->set_text( str ); break; glutsetwindow( MainWindow ); glutpostredisplay( ); 7