cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Function to change surface color

ZS_10383889
6-Contributor

Function to change surface color

Hello friends,

 

What is the function used to change the surface color using toolkit?

1 ACCEPTED SOLUTION

Accepted Solutions
FV
17-Peridot
17-Peridot
(To:ZS_10383889)

4 REPLIES 4
FV
17-Peridot
17-Peridot
(To:ZS_10383889)

ProSurface.h

FV_0-1666716783311.png

 

ZS_10383889
6-Contributor
(To:FV)

Thank you!

ZS_10383889
6-Contributor
(To:FV)

Some problem:

Any change in RGB value results in Black Output.

 

After getting current appearence_properties using 

     ProSurfaceSideAppearancepropsGet(&p_model_item, 0, &appearance_properties);

I modify it 

     appearance_properties.color_rgb[0] = 1.0;
     appearance_properties.color_rgb[1] = 1.0;
     appearance_properties.color_rgb[2] = 0.0;

in order to get yellow, but still get black.

 

How to set RGB value properly?

FV
17-Peridot
17-Peridot
(To:ZS_10383889)

check the validity of '&p_model_item' - looks like an error...

try this:

void test_yellow ( ProGeomitem *p_gi)
{
ProSurfaceAppearanceProps prop;
ProError err = ProSurfaceSideAppearancepropsGet( p_gi, 0, &prop);
prop.color_rgb[0] = 1.0;
prop.color_rgb[1] = 1.0;
prop.color_rgb[2] = 0.0;
err = ProSurfaceSideAppearancepropsSet( p_gi, 0, &prop );
}

 

Top Tags