Cancel
Showing results for 
Search instead for 
Did you mean: 

Changing color in 3D

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

I found a method to change colour in 3D in help file

 

MySingleProc.set3DColor(makeRGBValue(255,0,0)); -- colors the SingleProc in 3D red

 

I have tried using it on a line, by having a sensor which will trigger this method  and change the color of MU moving on a line. But, i am getting error as "Unknown Identifier".

 

My method is

@.set3dcolor := (makeRGBValue(255,0,0));

 

Can someone please point out mistake in method.

 

Thanks in advance. . .

 

5 REPLIES

Re: Changing color in 3D

Phenom
Phenom

Hi,

 

Have a look at "Create State Object" (3d)

 

Here you can create an individual 3d state object ( e.g. red Mu)

 

and trigger it through a created corresponding 2d (state) icon ( for instance "red")

 

by calling @.currIcon:="red";

 

 

Bild1.jpg

 

 

Re: Changing color in 3D

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

You can also use the method:

@._3D.setGraphicMaterial (see help)

to set the color by SimTalk.

 

change_color_3D_en.gif

 

Look here for an example: http://www.bangsow.de/detail_en.php?id=645

 

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Changing color in 3D

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Thanks for quick reply. Now i am able to change graphics during simulation. :-)

Re: Changing color in 3D

Siemens Phenom Siemens Phenom
Siemens Phenom

Hello,

 

thank you, Learner, for the hint to the outdated method set3dcolor. The documentation is updated.

 

The proposed solution will turn off the inheritance of the graphics. In most applications  it is not recommended.

 

It is better to create a second graphic group and switch die visibility by an instruction like

@._3d.VisibleGraphics := makeArray("graphic")

Regards,

Peter

Re: Changing color in 3D

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Hello Peter,

 

Thanks for the inputs. I have used this concept in my work.

 

-Regards

learner