Need HELP: AIS_TexturedShape

Dear all:

I have the following code in order to texture a shape?
Can someone tell me what's wrong?
All I get is a black face...

Thanks in advance, Sofia Gameiro

Handle(Geom_Surface) surface = BRep_Tool::Surface(aFace);
Standard_Real Umax, Vmax, Umin, Vmin;
surface->Bounds(Umin, Umax, Vmin, Vmax);

// Creat AIS_TexturedShape
Handle_AIS_TexturedShape Texture = new AIS_TexturedShape(aFace);
TCollection_AsciiString aFile("D:\\Programming\\OpenCascade\\ShoeHeel\\Textures\\carrelage1.gif");

Texture ->SetTextureFileName(aFile);
Texture ->SetTextureMapOn();
Texture ->SetTextureOrigin (TRUE,Umin, Vmin);
Texture ->SetTextureRepeat(FALSE);
Texture ->SetTextureScale(Standard_True, 1, 1);

Texture ->SetDisplayMode(3);

pDoc->heelRootLabel.ForgetAllAttributes();
//myAISContext->SetDisplayMode(Texture,3,TRUE);
myView->SetSurfaceDetail(V3d_TEX_ALL);
myAISContext->Display(Texture,3);
myAISContext->UpdateCurrentViewer();

Jérome Dufaure's picture

hello
Probably your path to the TextureFile is wrong.
Try this TCollection_AsciiString aFile("D:\\Programming\OpenCascade\ShoeHeel\Textures\carrelage1.gif");

I hope this will help you

Patrik Mueller's picture

Hi Sofia,

perhaps helps this hint: http://www.opencascade.org/org/forum/thread_7271/

Greets,

Patrik