duebg -> AIS_TexturedShape???

hi~
I import a image file to map texture on shape,the image become black .
I don't know why?? Is it a bug for AIS_TexturedShape. If not,
What wrong is for my codes?

Handle_AIS_TexturedShape aTShape = new AIS_TexturedShape(aShape);

TCollection_AsciiString aFile(aFileName);
aTShape->SetTextureFileName(aFile);
aTShape->SetTextureRepeat(FALSE,1,0);
aTShape->SetTextureMapOn();
aTShape->SetTextureScale(FALSE,0.5,0.5);
aTShape->SetDisplayMode(3);

myView->SetSurfaceDetail(V3d_TEX_ALL);
myCurrentIC->Display(aTShape);
myCurrentIC->UpdateCurrentViewer();

mbd_forever's picture

Hi,

Just try this code :

myView->SetSurfaceDetail(V3d_TEX_ALL);
TopoDS_Shape B = BRepPrimAPI_MakeBox (10, 10, 10);
Handle (AIS_TexturedShape) aTShape = new AIS_TexturedShape (B);
TCollection_AsciiString aFile("c:\\TEMP\\TextureMapping\\res\\CasCadeLogo.bmp");
aTShape->SetTextureFileName(aFile);
aTShape->SetTextureMapOn();
aTShape->SetDisplayMode(3);
myAISContext->Display(aTShape);
myAISContext-> UpdateCurrentViewer();
aTShape->UpdateAttributes();

This code works !

mbd_forever

Eric Ro's picture

I try this code. impressional alike.
Handle(V3d_Viewer) myViewer = myCurrentIC->CurrentViewer();
myViewer->InitActiveViews();
Handle(V3d_View) myView = myViewer->ActiveView();
myView->FitAll(0.01,Standard_True);
myView->SetSurfaceDetail(V3d_TEX_ALL);

If should warning spice please tell me thank.

if you have icq number ?
can you mail give me ?