Creating a pixmap and rotating it

Hi everyone,

Is there anyway to create an Image_PixMap (from a .png image file stored in the file system), rotate said pixmap, and then apply the rotated pixmap it to a AIS_TexturedShape?

I'm trying to find a way to rotate a texturemap before applying it to an AIS_TexturedShape.

Kirill Gavrilov's picture

OCCT is not image processing library - if you want to modify image, it is better looking onto specific libraries doing such job.
FreeImage (the one used by Image_AlienPixMap for loading files) has rotation methods as far as I know.

If you are looking for texture mapping rotation instead of manipulating image itself - take a look onto Graphic3d_TextureParams properties.
Draw Harness command vtexture demonstrates how these options can be modified in simplest case.

AIS_TexturedShape class has been deprecated - AIS_Shape should be used instead, check documentation of these classes.

Frank Martinez's picture

Hi @Kirill,

You said that AIS_TexturedShape is deprecated, can you show how to set the texture in AIS_Shape? I find no methods to set the texture file in AIS_Shape:

        Handle(AIS_TexturedShape) textured = new AIS_TexturedShape(shape);
        textured->SetTextureFileName("...../texture.jpg");
        textured->SetTextureMapOn();
        textured->SetDisplayMode(3);

Thank you.

jjones_152529's picture

Thank you for your reply.

Image_Pixmap does not seem to inherit from Graphic3d in any way - How would i go about rotating a pixmap with Graphic3d_TextureParams?

I'm not trying to permanently edit the image's file, i just want to rotate it in memory before applying it to an AIS shape.

-Jared

lizhiyong4216_140558's picture

hey, Jared, Have you figured out to solve the problem? I run into the problem as you described. I wanted to map a texture file to a shape, but the direction is not what i wanted, and the better way is to set the direction editable, but i didn't find the way.

Looking forward to your reply.

Li

jjones_152529's picture

Can anyone help me out?