For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

I don't manage texturization

Anonymous's picture


please, maybe someone could help me: I'd like to texturize a simple face with a bitmap but my code don't do it.

My code:

Handle_Geom_Surface masurf;
TopoDS_Shape aShapetopo = BRepBuilderAPI_MakeFace(masurf);

TopTools_IndexedMapOfShape aFaces;
TopExp::MapShapes(aShapetopo, TopAbs_FACE, aFaces);

Handle_AIS_Shape aShapeIO = drawShape(aShapetopo, Graphic3d_NOM_BRASS, Standard_False);
GetAISContext()->SetDisplayMode(aShapeIO, AIS_Shaded, Standard_False);

GetAISContext()->Display(aShapeIO, Standard_False);

Handle_AIS_TexturedShape aTFace1 = Texturize(aFaces(1), "InterferenceintradoT4.bmp", 1, 1, 3, 2,0,0);
GetAISContext()->Display(aTFace1, Standard_False);


Handle_AIS_TexturedShape CAISSelectDoc::Texturize
( const TopoDS_Shape& aShape,
TCollection_AsciiString aTFileName,
Standard_Real toScaleU,
Standard_Real toScaleV,
Standard_Real toRepeatU,
Standard_Real toRepeatV,
Standard_Real originU,
Standard_Real originV)

Handle_AIS_TexturedShape aTShape = new AIS_TexturedShape(aShape);

aTShape->SetTextureScale(Standard_True, toScaleU, toScaleV);
aTShape->SetTextureRepeat(Standard_True, toRepeatU, toRepeatV);
aTShape->SetTextureOrigin(Standard_True, originU, originV);


return aTShape;

Roman Lygin's picture

Hi Manu,

Make sure your initialize texture use in your 3D view calling V3d_View::SetSurfaceDetail(V3d_TEX_ALL). Have a look at TexturedShapes shapes supplied with OCC on Windows.

Hope this helps.

MANU's picture

Thank you very much Roman Lygin

My face is now texturized, but I have another trouble:

There remain orange colour behind the picture i have mapped on the face . I've tried many things to avoid it, but I don't manage to change the face background color when it is textured, or to reduce the transparency aspect (white pixels of my picture appear in orange). Beside, I notice that this aspect is present in the mfc sample ( Textured shapes ) .

Do you know a way I can walk to solve my problem ?

Roman Lygin's picture

Hello Manu,

Frankly, I didn't understand the point here. Perhaps a screenshot would help or tell me what to do in the TexturedShapes sample.

MANU's picture

I apologize for my poor speaking english.

How can I send you my screenshots ?

my mail:

Roman Lygin's picture

Hi Manu, I sent you an email from my private address.

Roman Lygin's picture

Hi Manu,

I decided to post the answer here to let other community members benefit. First, the context: textures over shapes look quite different from original graphical images (most noticable - yellow hue).

The problem you describe is not that the color gets transparent. It's linked with light reflection on textured shapes. If you take the Textured Shapes example and open a sample with a kitchen furniture (most representative one) then rotate, or apply top/left/right view, then you will notice that image's color gets closer to its native one when being perpendicular to the eye direction.

The cause is that texture is mapped on a shape using Brass material (default one for OCC shapes - you may remember their yellow hue). In order to ensure more natural color you would need to apply another material but AIS_TexturedShape has a limitation (or a bug ?) ignoring associated material and always using brass inside.

On my own I created a custom class taking the materials into account. You should also be able to accomplish that, e.g. subclassing AIS_TexturedShape and redefining Compute() method (you might want to use AIS_TexturedShape::Compute(), Prs3d_ShadedShape::Add() as references).

Hope this helps you.

Patrik Müller's picture

Hi Roman,

good to see you so active at the forum (and nicer to hear from you again). I have a similar problem doing environment mapping and posted the question already to this forum. Could you give me a hint?



Roman Lygin's picture

Hi Patrik,

Please repeat your post or link to it (URL), as I don’t remember what it was. Just post some update into initial thread to make it pop up.


Patrik Müller's picture

Hi Roman,

here it was: