Fwd: Texture Mapping Problem....Please Help !!!!!

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: Texture Mapping Problem....Please Help !!!!!

Deepak Roy Chittajallu
Hello Marc,
 
Thanks for the reply again. You have been really helpful.
 
Attached are the images in texture mode and wireframe mode. The image corresponds to the stomach section of the human body surface model i have. I have cutout the face and stuff since i am not supposed to reveal the identity.
 
>>>> Did you try passing the data through a vtkPolyDataNormals filter ?
 
Yes i did pass the vtkPolyData through a vtkPolyDataNormals Filter, but it makes no difference. The cracks are still there. Here is the pseudocode :
 

vtkPolyDataNormals *pMeshNormalGenerator = vtkPolyDataNormals::New();

pMeshNormalGenerator->SetInput( pInputMesh );

pMeshNormalGenerator->SetFeatureAngle( 60.0 );

pMeshNormalGenerator->Update();

Waiting for your reply.....

Regards,

Deepak

 



_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

tex_img.JPG (11K) Download Attachment
wire_img.JPG (30K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Texture Mapping Problem....Please Help !!!!!

Deepak Roy Chittajallu
Hello Marc,
 
Thanks for the reply again. I greatly appreciate your effort.
 
I see that, the reason behind your cracks has got something to do with the geometry problems rather than texture, as you see the cracks even if the texture is not applied.
 
Unlike you, in my case if i do not apply the texture, the model exhibits no cracking whatsoever. This is the reason, i was sure that there is something wrong with the texture rather than the geometry in my case.
 
I am not sure what might be the problem ?
 
When I pass the data through a quadric decimation algorithm, like you I lose the texture (not sure why) but the cracks disappear.
 
I guess the reason you loose the texture once you decimate your mesh is may be the per vertex texture information is not calculated by VTK internally for the new decimated mesh. For that reason probably the decimated mesh is displayed in uniform solid color.
 
I assume you tried ->PreventSeamOn() right?
what is this for.
 
Waiting for your reply...

 
On 1/17/06, Marc Cotran <[hidden email]> wrote:
Deepak Roy wrote:

> vtkPolyDataNormals *pMeshNormalGenerator = vtkPolyDataNormals::New();
>
> pMeshNormalGenerator->SetInput( pInputMesh );
>
> pMeshNormalGenerator->SetFeatureAngle( 60.0 );
>
> pMeshNormalGenerator->Update();
>
> Waiting for your reply.....
>
Hi Deepak,

I was able to reproduce the cracks using the example I sent just now but
with a vtkCleanPolyData object instead of a vtkClipPolyData object...
I'm wondering now if you have a vtkCleanPolyData object somewhere in
your pipeline that is somehow responsible for the cracks.

Marc


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Texture Mapping Problem....Please Help !!!!!

Deepak Roy Chittajallu
In reply to this post by Deepak Roy Chittajallu
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 <[hidden email]> 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
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Texture Mapping Problem....Please Help !!!!!

Deepak Roy Chittajallu
 
Hello Marc,
 
I had the idea of trying different texture interpolation options long back but was impaired by the facility that vtkTexture provides. All that is offered in the public interface of the vtkTexture class is Interpolate On/Off. It does not give me any provision to change the way the interpolation is done.
 
I also posted a question on VTK long back, but no one replied. I think it is time to post one again.
 
 
>> Also, have you tried different texture files? Is the crack pattern, if
reproducible, the same?
 
I have the human body surface models of 10 subjects in the form of vrml files. The pattern of cracks, though not exactly the same in all these cases ( if you are very picky about the exact regions where these cracks are visible)  look similar.
 
I also tried some VRML triangular meshes of Human Faces, by borrowing them from a Face Project group here. I see similar type of cracks even in those face models. All the 3 face models i tested have more or less similar pattern of cracks though not exactly similar.
 
However in all these cases, if i do not apply the texture there are no cracks whatsoever.
 
Wiaitng for your comments.....
 
Regards,
 
Deepak
 
On 1/17/06, Marc Cotran <[hidden email]> wrote:
Deepak Roy wrote:

> Seems like a lot of mutually benefiting discussion. I like it.

Indeed...

>
> 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.

No I do not - but have you tried using Flat interpolation instead of
Gouraud or Phong? This will help me figure out if you are having a
problem with the geometry or the texture.
 
Also, have you tried different texture files? Is the crack pattern, if
reproducible, the same?

>
> I hope this might solve my problem.

I really don't have enough experience with vtkTextures to say either way...

Marc
 


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: Fwd: Texture Mapping Problem....Please Help !!!!!

Deepak Roy Chittajallu
Hello Marc,
 
I tried all three --- shading interpolation options ( Flat , Goroud and Phong ).
 
There is no differenece. It does not help.
 
I wonder what the problem is ?
 
Regards,
 
Deepak

 
On 1/17/06, Marc Cotran <[hidden email]> wrote:
Deepak Roy wrote:

>
> I had the idea of trying different texture interpolation options long
> back but was impaired by the facility that vtkTexture provides. All
> that is offered in the public interface of the vtkTexture class is
> Interpolate On/Off. It does not give me any provision to change the
> way the interpolation is done.

Maybe I wasn't clear on my question... I meant to apply interpolation to
the vtkActor's vtkProperty - not to the texture. As in:

myActor->GetProperty()->SetInterpolationToFlat();

Please try that and let me know what happens!

Marc


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: Fwd: Texture Mapping Problem....Please Help !!!!!

Deepak Roy Chittajallu
In reply to this post by Deepak Roy Chittajallu


---------- Forwarded message ----------
From: Deepak Roy <[hidden email]>
Date: Jan 17, 2006 5:49 PM
Subject: Re: Fwd: [vtkusers] Texture Mapping Problem....Please Help !!!!!
To: Ankur Deshmukh <[hidden email]>

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 <[hidden email] > 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* <[hidden email] <mailto:[hidden email]>> 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: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers
>
>



_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Texture Mapping Problem....Please Help !!!!!

Deepak Roy Chittajallu
In reply to this post by Deepak Roy Chittajallu
Hey Ankur,
 
I cannot get a clear picture.
 
Can you post your pseudocode ?
 
Regards,
 
Deepak
 
On 1/18/06, Ankur Deshmukh <[hidden email]> 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* <[hidden email]
> <mailto:[hidden email]> > 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* < [hidden email]
>     <mailto:[hidden email]> <mailto:[hidden email]
>     <mailto:[hidden email]>>> 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>
>     >
>     >
>
>



_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Loading...