
Sat, 06/16/2007 - 22:53
Does anyone know how to apply environment mapping texture
on a particular AIS_Shape or AIS_TexturedShape ?
After searching a bit i found that OCC supports this on
a per V3d_View basis with the use of Graphic3d_TextureEnv object.
This means that it is a global parameter for all objects on the view.
Even trying the above i had no luck at all.
My code looks like :
Handle(Graphic3d_StructureManager) the_struct_manager = Child->myAISContext->MainPrsMgr()->StructureManager();
Handle_Graphic3d_TextureEnv texture_env = new Graphic3d_TextureEnv(the_struct_manager,"c:\\env_sky1.rgb");
Child->Frame_OGL->myView->SetTextureEnv(texture_env);
aStrucMana->Update();
Child->Frame_OGL->myView->Update();
I really don't know if i do something wrong ...
Any help would be appreciatable
With owner
Sioutis Fotis
Sun, 06/17/2007 - 03:56
Found it !!
Environment mapping does not apply to a shape as texture but as material !
Step 1 :
Look at the code above
Step 2 :
Handle_AIS_Shape Shape = new AIS_Shape(Child->myAISContext->SelectedShape());
Graphic3d_MaterialAspect mat;
mat.SetEnvReflexion(1);
Shape->Attributes()->ShadingAspect()->SetMaterial(mat);
Child->myAISContext->Display(Shape);
, To apply environment mapping to the selected shape