Docsity

Assignment 3 Solved Problem - Advanced Computer Graphics | 22C 251, Assignments of Computer Graphics

Toggle sidebar
bg1
Spring 2009
22C:251 Visualization
Assignment 3
Due: Friday, April 24th at 11:59pm
Goal: Create a simple flow visualization application in VTK using a “hedgehog,” a glyph-based representation, and
streamlines.
Problem 1 (50 points): Download and compile the sample VTK flow visualization applications from the web page,
and modify it to render using the following algorithms:
•10 points: A hedgehog visualization. Note, the default program already displays using a hedgehog, but the lines are way too
long. Determine appropriate hedgehog scaling factors for “testData1.vtk” “testData2.vtk” and “carotid.vtk.” Place images
of “an appropriate size” on your web page, or explaing why this is not feasible.
•20 points: Instead of using a hedgehog, use a glyph-based visualization. In order to avoid creating a complex glyph such
as an arrowhead, you should use a simple cone instead of an arrow.
–You will need to replace the hhog inside mapper->SetInputConnection(hhog->GetOutputPort())
with your new glyph-based filter specified using the vtkGlyph3D class.
–The vtkGlyph3D filter requires a SetInputConnection() to attach the input vector data.
–A SetSourceConnection() is required to specify the glyph (in this case a cone from a vtkConeSource).
–Other methods you may need inside the vtkGlyph3D class include SetScaleFactor() and SetScaleModeToScaleByVec-
tor().
Explore what size cones are most appropriate for the three datasets specified above and place images on your web page.
•20 points: Now, you’ll implement a streamline based visualization. Again, this is performed using a filter analogous
to vtkGlyph3D or vtkHedgeHog. The class you need is called vtkStreamLine. You can test a straightforward implemen-
tation by simply creating a vtkStreamLine class, and connecting the approproate inputs and outputs. Unfortunately, by
default vtkStreamLine uses only a single stream (not particularly useful for displaying details in a complex vector field).
Fortunately, you can use numerous streamlines by specifying their start points using streamLines->SetSource(
startPoints ), where startPoints is a vtkPointSet.
–Stream starting points must be in the range 0≤x≤76,0≤y≤49, and 0≤z≤45 for the carotid dataset.
–Stream starting points must be in the range 0≤x, y ≤36,z= 0 for the testData1 dataset.
–Stream starting points must be in the range 0≤x, y ≤357,z= 0 for the testData2 dataset.
Note that the points in a vtkPointSet can be specified with the method SetPoints(), which takes an input of type vtkPoints.
You can specify points in the vtkPoints class using the method InsertPoint().
You mayspecify additional streamlines by either (or both):
–Starting streamlines on a regular grid throughout the datasets.
–Allowing the user to interactively add streamlines by clicking to add points where additional streams start.
Explore to find an appropriate number of streamlines for each of the three datasets, and place the results on your web page.
•Extra: Using the vtkStreamPoints class, you can create sampling points along streamlines. When used in conjunction with
the the vtkGlyph3D class, you can have your cones / arrows aligned tip-to-base, rather than in a regular grid pattern.
REMEMBER: If you have not yet done so, immediately send me an e-mail listing your web address where I can go
to see your homework results.

Partial preview of the text

Download Assignment 3 Solved Problem - Advanced Computer Graphics | 22C 251 and more Assignments Computer Graphics in PDF only on Docsity!

Spring 2009

22C:251 Visualization

Assignment 3

Due: Friday, April 24th at 11:59pm

Goal: Create a simple flow visualization application in VTK using a “hedgehog,” a glyph-based representation, and

streamlines.

Problem 1 (50 points): Download and compile the sample VTK flow visualization applications from the web page,

and modify it to render using the following algorithms:

  • 10 points: A hedgehog visualization. Note, the default program already displays using a hedgehog, but the lines are way too long. Determine appropriate hedgehog scaling factors for “testData1.vtk” “testData2.vtk” and “carotid.vtk.” Place images of “an appropriate size” on your web page, or explaing why this is not feasible.
  • 20 points: Instead of using a hedgehog, use a glyph-based visualization. In order to avoid creating a complex glyph such as an arrowhead, you should use a simple cone instead of an arrow. - You will need to replace the hhog inside mapper->SetInputConnection(hhog->GetOutputPort()) with your new glyph-based filter specified using the vtkGlyph3D class. - The vtkGlyph3D filter requires a SetInputConnection() to attach the input vector data. - A SetSourceConnection() is required to specify the glyph (in this case a cone from a vtkConeSource). - Other methods you may need inside the vtkGlyph3D class include SetScaleFactor() and SetScaleModeToScaleByVec- tor(). Explore what size cones are most appropriate for the three datasets specified above and place images on your web page.
  • 20 points: Now, you’ll implement a streamline based visualization. Again, this is performed using a filter analogous to vtkGlyph3D or vtkHedgeHog. The class you need is called vtkStreamLine. You can test a straightforward implemen- tation by simply creating a vtkStreamLine class, and connecting the approproate inputs and outputs. Unfortunately, by default vtkStreamLine uses only a single stream (not particularly useful for displaying details in a complex vector field). Fortunately, you can use numerous streamlines by specifying their start points using streamLines->SetSource( startPoints ), where startPoints is a vtkPointSet. - Stream starting points must be in the range 0 ≤ x ≤ 76 , 0 ≤ y ≤ 49 , and 0 ≤ z ≤ 45 for the carotid dataset. - Stream starting points must be in the range 0 ≤ x, y ≤ 36 , z = 0 for the testData1 dataset. - Stream starting points must be in the range 0 ≤ x, y ≤ 357 , z = 0 for the testData2 dataset. Note that the points in a vtkPointSet can be specified with the method SetPoints(), which takes an input of type vtkPoints. You can specify points in the vtkPoints class using the method InsertPoint().

You may specify additional streamlines by either (or both):

- Starting streamlines on a regular grid throughout the datasets. - Allowing the user to interactively add streamlines by clicking to add points where additional streams start. Explore to find an appropriate number of streamlines for each of the three datasets, and place the results on your web page.

  • Extra: Using the vtkStreamPoints class, you can create sampling points along streamlines. When used in conjunction with the the vtkGlyph3D class, you can have your cones / arrows aligned tip-to-base, rather than in a regular grid pattern.

REMEMBER: If you have not yet done so, immediately send me an e-mail listing your web address where I can go

to see your homework results.