173 | | |
| 173 | == Hints for generating a textured sphere == |
| 174 | As there are some bugs in !ParaView, a nice looking textured sphere must be defined as follows: |
| 175 | * Don't set the !EndTheta of the sphere to 360. Instead use a little bit lower value: "sphere.!EndTheta = 359.9999" |
| 176 | * To use a texture, the !TextureMaptoSphere filter must be attached to the sphere via "textureMaptoSphere = !TextureMaptoSphere(Input=sphere)". To work correctly, the !PreventSeam attribute has to be disabled: "textureMaptoSphere.!PreventSeam = 0" |
| 177 | * here is how to attach a texture image to the sphere (tested with !ParaView 5.5): |
| 178 | {{{ |
| 179 | #!python |
| 180 | textureMaptoSphere = TextureMaptoSphere(Input=sphere) |
| 181 | textureMaptoSphere.PreventSeam = 0 |
| 182 | textureMaptoSphereDisplay = Show(textureMaptoSphere, renderView) |
| 183 | textureMaptoSphereDisplay.Representation = 'Surface' |
| 184 | texProxy = servermanager.CreateProxy("textures", "ImageTexture") |
| 185 | texProxy.GetProperty("FileName").SetElement(0, "./images_earth/earth_heller_transformed.jpg") |
| 186 | texProxy.UpdateVTKObjects() |
| 187 | textureMaptoSphereDisplay.Texture = texProxy |
| 188 | }}} |