[Paraview] OSPray rendering: ERROR: VolumeMapper's Input has no scalar array!
Jiahui Luo
luo229 at gmail.com
Fri Jan 20 02:45:10 EST 2017
Hi ,
I got an error message when trying to do volume rendering on the output
of the ResampleToImage filter:
ERROR: In
/home/user/apps/paraview5.2.0-build/superbuild/paraview/src/VTK/Rendering/OSPRay/vtkOSPRayVolumeMapperNode.cxx,
line 107
vtkOSPRayVolumeMapperNode (0x68c2ad0): VolumeMapper's Input has no
scalar array!
Here is how it happened.
First, I added a ProgrammableSource with Output DataSet Type set to
vtkRectilinearGrid and apply something like this,
import numpy as np
# Read x,y,z,th from file
xCoords = vtk.vtkDoubleArray()
for i in x:
xCoords.InsertNextValue(i)
yCoords = vtk.vtkDoubleArray()
for i in y:
yCoords.InsertNextValue(i)
zCoords = vtk.vtkDoubleArray()
for i in z:
zCoords.InsertNextValue(i)
output.SetDimensions(len(x), len(y), len(z))
output.SetXCoordinates(xCoords)
output.SetYCoordinates(yCoords)
output.SetZCoordinates(zCoords)
thArray = vtk.vtkFloatArray()
thArray.SetName("Temperature")
thArray.SetNumberOfComponents(1)
thArray.SetNumberOfTuples(nx*ny*nz)
for k in range(nz):
for j in range(ny):
for i in range(nx):
index = i+j*nx+k*ny*nx
thArray.SetValue(index, th[k,j,i])
output.GetCellData().SetScalars(thArray)
return output
Since volume rendering can not be done on rectilinear grid. I added a
ResampleToImage filter on this source.
Then I could do volume rendering using Ray cast or GPU based, but not
OSPray and the above message popped up.
How to make this work? Thanks.
Jiahui Luo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20170120/f347c9f5/attachment.html>
More information about the ParaView
mailing list