Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forums
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forums / Usage issues / Avoid Yellowish color in AIS_TexturedShape

Avoid Yellowish color in AIS_TexturedShape

Avoid Yellowish color in AIS_TexturedShape
Massimo Del Fedele 2012/12/01 18:35
As seen in some previous posts, AIS_TexturedShape has a bug that prevents using different material than
default one (Bronze), giving to all textured shapes a yellowish color.
After many trial and error, I found a simple patch for AIS_TexturedShape.cxx that solves the problem; from line 369

if (DoRepeat)
mytexture->EnableRepeat();
else
mytexture->DisableRepeat();

const gp_Pnt2d aUVOrigin (myUOrigin, myVOrigin);
const gp_Pnt2d aUVRepeat (myURepeat, myVRepeat);
const gp_Pnt2d aUVScale (myScaleU, myScaleV);

just insert a couple of lines, resulting in :

if (DoRepeat)
mytexture->EnableRepeat();
else
mytexture->DisableRepeat();

myAspect->SetFrontMaterial(Material());
myAspect->SetBackMaterial(Material());

const gp_Pnt2d aUVOrigin (myUOrigin, myVOrigin);
const gp_Pnt2d aUVRepeat (myURepeat, myVRepeat);
const gp_Pnt2d aUVScale (myScaleU, myScaleV);

This will allow TexturedShape to fetch its material during shading; choosing a more 'neutral'
material (like silver-steel-plastic) will then give a quite realistic result.

I'd suggest it as a patch for TexturedShape.cxx

Ciao

Max

 
 
Latest news
  • Open CASCADE Technology 6.7.0 is available for download!
  • Open CASCADE Technology 6.6.0 is available for download!
  • Open CASCADE Technology 6.5.5 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map