
Thu, 05/07/2015 - 23:50
I am attempting to apply a texture to the bottle in the tutorial located in $OPENCASCADEROOT/samples/qt/Tutorial.
// Here the AIS_shape is created.
DocumentTut.cxx:26: Handle(AIS_Shape) AISBottle=new AIS_Shape(aBottle);
I assume I'll have to grab a reference to the shape somehow, somewhere...
For inspiration, I'm going to look at how the buttons in the example toggle the surface from shaded display to wireframe display.
I've taken a look at Doxygen documentation and I found some texture stuff, in particular, the class OpenGl_Texture.
So, I will need to get a reference to AISBottle, create an OpenGl_Texture object, and somehow put these together. Am I on the right path?
I know there are also lower level ways to access presentable/selectable objects, this isn't one of the cases where I need to do that is it?
Wed, 03/23/2016 - 05:57
Hi Adam !
Even I have to implement same functionality in my project.Can you please let me know if you find the solution.
Regards
Wed, 03/23/2016 - 10:20
Dear Adam,
The simplest way to attach texture to the shape is to use AIS_TexturedShape presentation object instead of AIS_Shape.
MFC samples (see $(CASROOT)\samples\mfc\) provides a code sample for using it (the appropriate Draw Harness command is vtexture),
but I think the documentation of this and related class should be sufficient to understand how to use it.
OpenGl_Texture is a low-level texture management class, you don't have to know it for using textures.
Best regards
FSR