Cancel
Showing results for 
Search instead for 
Did you mean: 

Change color of a 3D object

Creator
Creator

Hello,

 

I'm trying to change the color of a 3D entity, the 3D JT file comes from the a sample file (provided with Plant Simulation)

 

I tried with this method :

 

@._3D.setGraphicMaterial(makeArray(1),
color1, color1,color1,color1, 0, 0.11);

 

I didn't achieve to change the color in red, any idea to change the color ?

 

Attached my solution

 

Regards

 

3 REPLIES

Re: Change color of a 3D object

Siemens Phenom Siemens Phenom
Siemens Phenom
  1. The reason for this to not work with a probability of very close to 1 is that you have other materials in your graphic defined further down the structure. The deepestmost defined material "wins" and thus you achieve no visual change at all (if every graphic below is colored by itself). You can solve this by removing the materials below: Open the 3D properties dialog for the graphic in question, go to the material page and press the button with the large cross - this will remove all materials located below the node in question.
  2. But: Doing this this way on an MU is a very bad idea: MUs are frequent in a simulation and modifying the graphic of an object, in your case of the MU, cuts the graphic inheritance decreasing the overall performance of your simulation and increasing the size of your model. MUs offer an object material which you can set on the Appearance page or with the SimTalk attributes MaterialDiffuseColor etc. This will not cut the graphic inheritance and thus produce far better results performance-wise.
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution

Re: Change color of a 3D object

Phenom
Phenom

the graphic with the blue color is on a lower (7th) level

 

Unbenannt.PNG

Re: Change color of a 3D object

Creator
Creator
Thank's a lot for your great answer. It helped me to understand much better the best way to set the color. I used MaterialDiffuseColor to set the color. First I removed the color definition (button "Remove the materials in nested graphics") on the 7th level, thank's to the response from simulator.