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

Graphic3d_Texure2DManual

Anonymous's picture
Forums: 

Hello!

I've read some messages about texture mapping. I created some classes. I wanted to see on one class (inheriting from AIS_InteractiveObject)what does the standard textures look like. My object has got a Prs3d_ShadingAspect at the construction. myviewer is configured as SetDefaultSurfaceDetail(V3d_TEX_ALL);

I created a member that set a texture on my object it compiles well and debug well but it has no effect on my object.

void CBloc3D::SetTexture(Handle_AIS_InteractiveContext haisicAISContext) { Handle_PrsMgr_PresentationManager3d unPrsMgr=haisicAISContext->MainPrsMgr(); Handle_Graphic3d_StructureManager StrMgr=

unPrsMgr->StructureManager(); Handle_Graphic3d_Texture2Dmanual uneTexture=

new Graphic3d_Texture2Dmanual(StrMgr,Graphic3d_NOT_2D_BLUEWHITE_PAPER);

Handle_Prs3d_ShadingAspect unAspect=myDrawer->ShadingAspect(); Handle_Graphic3d_AspectFillArea3d uneZone = unAspect->Aspect(); uneZone->SetTextureMapOn(); uneZone->SetTextureMap(uneTexture); unAspect->SetAspect(uneZone);

myDrawer->SetShadingAspect(unAspect);

if(!haisicAISContext.IsNull()) { if(unPrsMgr->HasPresentation (this,1)) { Handle(Prs3d_Presentation) P = unPrsMgr->CastPresentation(this,1)->Presentation();

Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(P);

P->SetPrimitivesAspect(uneZone); G->SetGroupPrimitivesAspect(uneZone); } } myRecomputeEveryPrs =Standard_False; LoadRecomputable(1); }

The problem is that i only see a shading aspect changing from a current color to a black shading with nonsense with ever name of texture of type Graphic3d_Texture2DManual.

Can someone tell me why? And also what type of texture should work?

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.