Fwd: [vtkusers] Texture Mapping Problem....Please Help !!!!!

Deepak Roy cdeepakroy at gmail.com
Wed Jan 18 11:13:42 EST 2006


Hey Ankur,

I cannot get a clear picture.

Can you post your pseudocode ?

Regards,

Deepak

On 1/18/06, Ankur Deshmukh <adeshmuk at uccs.edu> wrote:
>
> Hey Deepak,
>
> I am using the medical datset provided by vtk. I am trying to map burn
> texture on to the headsq dataset. The burn texture is a jpeg image.
> When I do the mapping this is what i get:
> http://cs.uccs.edu/~asdeshmu/figure.png
>
> I am not sure how the mapping is getting all screwed up. Any help will
> be appreciated.
>
> Thanks
> Ankur
> Deepak Roy wrote:
>
> > Hey Ankur,
> >
> > I am not sure, on to what geometry your are trying to map your
> > texture. And also whether you are repeating the texture all over your
> > medical dataset.
> >
> > I'll go ahead and describe what i did in my case. Hope it is of some
> > help to you.
> >
> > My geomtery is a Triangular mesh - an open surface representation of a
> > Human Body. It is initially in the form of a VRML file and i have
> > written custom vtkPolyDataSource Filter that gives me a vtkPolyData of
> > the surface geometry i have.
> >
> > Once this is done, here is the pseudocode i followed:
> >
> >
> ****************************************************************************************************************************
> >
> > vtkPolyData *pVtkMesh = FromVrmlFile( <vrml-model-file> );
> >
> > // create mesh polydata mapper
> >
> > vtkPolyDataMapper *pMeshMapper = vtkPolyDataMapper::New();
> >
> > pMeshMapper->SetInput( pVtkMesh );
> >
> > // read texture image from file vtkImageReader2Factory
> > *pImageReaderFactory = vtkImageReader2Factory::New();
> >
> > vtkImageReader2 *pTextureImageReader = vtkImageReader2::New();
> >
> > pTextureImageReader =
> > pImageReaderFactory->CreateImageReader2(strTextureFile);
> >
> > pTextureImageReader->SetFileName(strTextureFile);
> >
> > // build texture vtkTexture *pModelTexture = vtkTexture::New();
> >
> > pModelTexture->SetInput( pTextureImageReader->GetOutput() );
> >
> > pModelTexture->InterpolateOff();
> >
> > pModelTexture->RepeatOff();
> >
> > // create and setup actor vtkActor * pTorsoTextureActor =
> > vtkActor::New();
> >
> > pTorsoTextureActor->SetMapper( pMeshMapper );
> >
> > pTorsoTextureActor->SetTexture( pModelTexture );
> >
> >
> *************************************************************************************************************
> >
> > Regards,
> >
> > Deepak
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On 1/17/06, *Ankur Deshmukh* <adeshmuk at uccs.edu
> > <mailto:adeshmuk at uccs.edu> > wrote:
> >
> >     Hey Deepak,
> >
> >     I am having problems with mapping my texture to a medical data set.
> I
> >     was wondering if you could send me your code on how you have
> achieved
> >     the texture mapping.
> >
> >     Thanks
> >     Ankur
> >
> >     Deepak Roy wrote:
> >
> >     > Hello Marc,
> >     >
> >     > Seems like a lot of mutually benefiting discussion. I like it.
> >     >
> >     > Infact i was looking for a way to play with the clamping and
> >     > interpolation options of the texture in VTK. But i found no way
> >     to do
> >     > this.
> >     >
> >     > All vtkTexture provides us is Interpolate On/Off and Repeat
> On/Off.
> >     >
> >     > Do you know how to change the way the texture interpolation is
> >     done.
> >     >
> >     > I hope this might solve my problem.
> >     >
> >     > Eagerly waiting for your reply .....
> >     >
> >     > Regards,
> >     >
> >     > Deepak
> >     >
> >     >
> >     >
> >     > On 1/17/06, *Marc Cotran* < marc at cotran.ca
> >     <mailto:marc at cotran.ca> <mailto:marc at cotran.ca
> >     <mailto:marc at cotran.ca>>> wrote:
> >     >
> >     >     Hi Deepak,
> >     >
> >     >     Quick question: does using Flat interpolation instead of
> >     Gouraud or
> >     >     Phong get rid of the cracks?
> >     >
> >     >     It does for me...
> >     >
> >     >     Marc
> >     >
> >     >
> >
> >------------------------------------------------------------------------
> >     >
> >     >_______________________________________________
> >     >This is the private VTK discussion list.
> >     >Please keep messages on-topic. Check the FAQ at:
> >     http://www.vtk.org/Wiki/VTK_FAQ <http://www.vtk.org/Wiki/VTK_FAQ>
> >     >Follow this link to subscribe/unsubscribe:
> >     >http://www.vtk.org/mailman/listinfo/vtkusers
> >     <http://www.vtk.org/mailman/listinfo/vtkusers>
> >     >
> >     >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060118/4e5676ef/attachment.htm>


More information about the vtkusers mailing list