[vtkusers] vtkRIBExporter problem
Rene Mandl
R.C.W.Mandl at chello.nl
Wed Apr 9 18:02:14 EDT 2003
Hi,
I try to export a simple polydata object with vtkRibExporter but
for some reason the color information is passed incorrectly.
(If I use another exporter like vtkVRMLExporter then the output is ok)
I have enclosed the tcl script, a file containing the polydata object
and the resulting rib file.
Is there someone who can tell me what I am doing wrong?
Regards,
Rene Mandl
the TCL script:
---------------------------------
#!/usr/local//bin/vtk -f
package require vtkinteraction
vtkPolyDataReader polyRead
polyRead SetFileName "example.pdata"
vtkPolyDataMapper mapper
mapper SetInput [ polyRead GetOutput ]
vtkActor actor
actor SetMapper mapper
# Create graphics stuff
vtkRenderer ren1
vtkRenderWindow renWin
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
vtkRIBExporter myRIB
vtkPolyDataWriter pwrite
ren1 AddActor actor
ren1 SetBackground 1 1 1
iren Initialize
iren AddObserver UserEvent {wm deiconify .vtkInteract}
# prevent the tk window from showing up then start the event loop
wm withdraw .
update
renWin Render
myRIB SetInput renWin
myRIB SetFilePrefix "example"
myRIB BackgroundOn
myRIB SetPixelSamples 1 1
myRIB Write
puts "file example.rib contains exported scene"
---------------------------------
the polydata object (in file "example.pdata"):
---------------------------------
# vtk DataFile Version 3.0
vtk output
ASCII
DATASET POLYDATA
POINTS 36 float
0 0 0 10 0 0 20 0 0
30 0 0 40 0 0 50 0 0
0 10 0 10 10 0 20 10 0
30 10 0 40 10 0 50 10 0
0 20 0 10 20 0 20 20 0
30 20 0 40 20 0 50 20 0
0 30 0 10 30 0 20 30 0
30 30 0 40 30 0 50 30 0
0 40 0 10 40 0 20 40 0
30 40 0 40 40 0 50 40 0
0 50 0 10 50 0 20 50 0
30 50 0 40 50 0 50 50 0
POLYGONS 25 125
4 0 1 7 6
4 1 2 8 7
4 2 3 9 8
4 3 4 10 9
4 4 5 11 10
4 6 7 13 12
4 7 8 14 13
4 8 9 15 14
4 9 10 16 15
4 10 11 17 16
4 12 13 19 18
4 13 14 20 19
4 14 15 21 20
4 15 16 22 21
4 16 17 23 22
4 18 19 25 24
4 19 20 26 25
4 20 21 27 26
4 21 22 28 27
4 22 23 29 28
4 24 25 31 30
4 25 26 32 31
4 26 27 33 32
4 27 28 34 33
4 28 29 35 34
CELL_DATA 25
COLOR_SCALARS scalars 3
0 0 0 0 0 0 0.8 0.8 0.8
0 0 0 0 0 0
0 0 0 0 0 0
0.7 0.7 0.7 0 0 0
0 0 0 0 0 0
0 0 0 0.6 0.6 0.6
0 0 0 0 0 0
0 0 0 0 0 0
0.5 0.5 0.5 0 0 0
0 0 0 0 0 0
0 0 0 0.4 0.4 0.4
0 0 0 0 0 0
POINT_DATA 36
---------------------------------
the output file (rib):
---------------------------------
rameBegin 1
Display "example.tif" "file" "rgba"
Declare "bgcolor" "uniform color"
Imager "background" "bgcolor" [1.000000 1.000000 1.000000]
PixelSamples 1 1
Projection "perspective" "fov" [30.000000]
Identity
Transform [-1.000000 0.000000 0.000000 0.000000 0.000000 1.000000
0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000
0.000000 1.000000 ]
Rotate -0.000000 0.000000 0.000000 1.000000
Rotate -0.000000 1.000000 0.000000 0.000000
Rotate 179.999995 0.000000 1.000000 0.000000
Translate -25.000000 -25.000000 -149.282028
Orientation "rh"
WorldBegin
LightSource "ambientlight" 1
LightSource "distantlight" 2 "intensity" [1.000000] "lightcolor"
[1.000000 1.000000 1.000000] "from" [25.000000 25.000000 149.282028]
"to" [25.000000 25.000000 0.000000]
AttributeBegin
TransformBegin
Opacity [1.000000 1.000000 1.000000]
Color [1.000000 1.000000 1.000000]
Surface "plastic" "Ka" [0.000000] "Kd" [1.000000] "Ks" [0.000000]
"roughness" [1.000000] "specularcolor" [1.000000 1.000000 1.000000]
ConcatTransform [1.000000 0.000000 0.000000 0.000000 0.000000 1.000000
0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000
0.000000 1.000000 ]
Polygon "P" [0.000000 0.000000 0.000000 10.000000 0.000000 0.000000
10.000000 10.000000 0.000000 0.000000 10.000000 0.000000 ] "N" [0.000000
0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000
0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.698039 0.698039 0.698039 0.000000 0.000000 0.000000 ]
Polygon "P" [10.000000 0.000000 0.000000 20.000000 0.000000 0.000000
20.000000 10.000000 0.000000 10.000000 10.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.800000 0.800000 0.800000 0.000000 0.000000 0.000000 0.698039 0.698039
0.698039 ]
Polygon "P" [20.000000 0.000000 0.000000 30.000000 0.000000 0.000000
30.000000 10.000000 0.000000 20.000000 10.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.800000 0.800000 0.800000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 ]
Polygon "P" [30.000000 0.000000 0.000000 40.000000 0.000000 0.000000
40.000000 10.000000 0.000000 30.000000 10.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 ]
Polygon "P" [40.000000 0.000000 0.000000 50.000000 0.000000 0.000000
50.000000 10.000000 0.000000 40.000000 10.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 ]
Polygon "P" [0.000000 10.000000 0.000000 10.000000 10.000000 0.000000
10.000000 20.000000 0.000000 0.000000 20.000000 0.000000 ] "N" [0.000000
0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000
0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000 0.698039
0.698039 0.698039 0.000000 0.000000 0.000000 0.600000 0.600000 0.600000 ]
Polygon "P" [10.000000 10.000000 0.000000 20.000000 10.000000 0.000000
20.000000 20.000000 0.000000 10.000000 20.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.698039 0.698039 0.698039
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 ]
Polygon "P" [20.000000 10.000000 0.000000 30.000000 10.000000 0.000000
30.000000 20.000000 0.000000 20.000000 20.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 ]
Polygon "P" [30.000000 10.000000 0.000000 40.000000 10.000000 0.000000
40.000000 20.000000 0.000000 30.000000 20.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 ]
Polygon "P" [40.000000 10.000000 0.000000 50.000000 10.000000 0.000000
50.000000 20.000000 0.000000 40.000000 20.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.498039 0.498039 0.498039 0.000000 0.000000
0.000000 ]
Polygon "P" [0.000000 20.000000 0.000000 10.000000 20.000000 0.000000
10.000000 30.000000 0.000000 0.000000 30.000000 0.000000 ] "N" [0.000000
0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000
0.000000 0.000000 1.000000 ] "Cs" [0.600000 0.600000 0.600000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 ]
Polygon "P" [10.000000 20.000000 0.000000 20.000000 20.000000 0.000000
20.000000 30.000000 0.000000 10.000000 30.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 ]
Polygon "P" [20.000000 20.000000 0.000000 30.000000 20.000000 0.000000
30.000000 30.000000 0.000000 20.000000 30.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 ]
Polygon "P" [30.000000 20.000000 0.000000 40.000000 20.000000 0.000000
40.000000 30.000000 0.000000 30.000000 30.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.400000 0.400000 0.400000 0.000000 0.000000
0.000000 ]
Polygon "P" [40.000000 20.000000 0.000000 50.000000 20.000000 0.000000
50.000000 30.000000 0.000000 40.000000 30.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.498039 0.498039 0.498039 0.000000 0.000000 0.000000 0.400000 0.400000
0.400000 ]
Polygon "P" [0.000000 30.000000 0.000000 10.000000 30.000000 0.000000
10.000000 40.000000 0.000000 0.000000 40.000000 0.000000 ] "N" [0.000000
0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000
0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.349020 0.000000 0.000000 0.000000 0.000000 0.000000 ]
Polygon "P" [10.000000 30.000000 0.000000 20.000000 30.000000 0.000000
20.000000 40.000000 0.000000 10.000000 40.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.658824 0.803922 0.396078 0.349020 0.000000
0.000000 ]
Polygon "P" [20.000000 30.000000 0.000000 30.000000 30.000000 0.000000
30.000000 40.000000 0.000000 20.000000 40.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.003922 0.000000 0.000000 0.658824 0.803922
0.396078 ]
Polygon "P" [30.000000 30.000000 0.000000 40.000000 30.000000 0.000000
40.000000 40.000000 0.000000 30.000000 40.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.400000 0.400000 0.400000 0.000000 0.000000 0.000000 0.003922 0.000000
0.000000 ]
Polygon "P" [40.000000 30.000000 0.000000 50.000000 30.000000 0.000000
50.000000 40.000000 0.000000 40.000000 40.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.400000 0.400000 0.400000
0.000000 0.000000 0.000000 0.345098 0.231373 0.470588 0.000000 0.000000
0.000000 ]
Polygon "P" [0.000000 40.000000 0.000000 10.000000 40.000000 0.000000
10.000000 50.000000 0.000000 0.000000 50.000000 0.000000 ] "N" [0.000000
0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000
0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000 0.349020
0.000000 0.000000 0.000000 0.000000 0.000000 0.003922 0.007843 0.000000 ]
Polygon "P" [10.000000 40.000000 0.000000 20.000000 40.000000 0.000000
20.000000 50.000000 0.000000 10.000000 50.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.349020 0.000000 0.000000
0.658824 0.803922 0.396078 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 ]
Polygon "P" [20.000000 40.000000 0.000000 30.000000 40.000000 0.000000
30.000000 50.000000 0.000000 20.000000 50.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.658824 0.803922 0.396078
0.003922 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 ]
Polygon "P" [30.000000 40.000000 0.000000 40.000000 40.000000 0.000000
40.000000 50.000000 0.000000 30.000000 50.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.003922 0.000000 0.000000
0.000000 0.000000 0.000000 1.000000 1.000000 1.000000 0.000000 0.000000
0.000000 ]
Polygon "P" [40.000000 40.000000 0.000000 50.000000 40.000000 0.000000
50.000000 50.000000 0.000000 40.000000 50.000000 0.000000 ] "N"
[0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 1.000000 ] "Cs" [0.000000 0.000000 0.000000
0.345098 0.231373 0.470588 0.011765 0.000000 0.000000 1.000000 1.000000
1.000000 ]
TransformEnd
AttributeEnd
WorldEnd
FrameEnd
---------------------------------
More information about the vtkusers
mailing list