[vtkusers] Re: One more note about textures.

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Thu Nov 2 14:10:09 EST 2000


>I have done part of the job you discussed in your old query about 
>textures.   It is possible
>to take serveral actors and a single texture and map pieces of the texture 
>on the individual
>actors.   You use vtkTransformTextureCoords to do the trick.   It's 
>great.   However, there is
>still a problem with large textures, regarless of whether you break them 
>into bitesize
>pieces.   I'm still looking for answer on this one.

Jim,

I made a
vtkTexturedTerrainAssembly class which is a subclass of vtkAssembly. it 
takes a file directory parameter and a terrain mesh as input. it Breaks the 
terrain mesh into MxN pieces (controlled by user) and uses the bottom left 
corner coordinate of each to generate a filename (UK ordnance Survey 
coordinates). It then scans the directory for textures (usually in 1kmx1km 
bmp pieces - aerial photos or OS maps) and maps pieces onto the MxN pieces 
we generated earlier.
By hooking into the Update mechanism of the prop-actor-assembly hierarchy 
it makes it possible (if so desired) to fly from one end of the country to 
the other and automatically regenerate pieces as you move from one region 
to another. Mine doesn't need this so no caching of tiles is performed, but 
it'd be straightforward to put something of the sort in.
Having done it, I think its OK, but where the tiles are clipped out of the 
initial mesh, artefacts occur, so I would rather have a texture array 
coordinate system. Alternatively using tiles of terrain would be better, 
but the nice thing about a mesh is that it can be from non-standard sources 
etc and reduced with a decimation algo...

I'm waffling on now. Must go.

JB






More information about the vtkusers mailing list