[vtkusers] volume rendering of matrices?

Roman Putanowicz putanowr at twins.pk.edu.pl
Mon May 19 06:40:53 EDT 2003


Hi Fredrik,
You can create object of class vtkStructuredPoints, get point data
from it (vtkPointData), get scalars array from it and fill the array.

I attached a quick and dirty example how to do it. In this example 
the array is filled from the file (raw binary file), 
but it can be filled from anything.

I hope this will help.

Cheers

Romek
> Hi all!
> 
> I have a current C/OpenGL app. that results in a 64x64 array that I render using OpenGL.
> Now I would like to move my app. to 3D by calculating a 64x64x64 grid. The problem is that I do not
> have the time to write a volume renderer that displays my grid. 
> 
> Since I have some previous experience with VTK I thought I might give it a go!
> When I previously used VTK I did all the calculations in VTK, or loaded a previously created volume and rendered it. Now I have a 64^3 array that I calculate for each frame (actually it is currently a 1D-array for speed purposes, so if that can be done as well it would be nice!). 
> 
> To get to the point:
> 
> * How do I best connect my 64^3 array to VTK? Any other things I should consider?
> Since the data in the volume changes for each frame I cannot simply output my volume to a file and load that into VTK (unless I do that every frame, but that seems awkward...)
> 
> Do you have any suggestions?
> 
> Thanks in advance
> 
> Fredrik Karlsson
-- 
    _/_/_/       _/     _/       _/_/_/_/_/    Roman Putanowicz 
  _/            _/     _/           _/         Inst.Comp.Meth.Civ.Eng.
 _/            _/     _/           _/          tel +48 12  628 2569
 _/_/_/racow   _/_/_/niversity of _/echnology  putanowr at twins.pk.edu.pl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: simimage.cxx
Type: text/x-c++src
Size: 4419 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030519/395db906/attachment.cxx>


More information about the vtkusers mailing list