Wish - Vismach change background color

More
3 years 1 month ago #279940 by zz912
I would like to ask the local developers to make it possible to change the background color in Vismach.

Thank you
Zdenek

Please Log in to join the conversation.

More
3 years 1 month ago #279942 by Aciera
I'm not a developer but if you need a quick fix you can change line 774 in 'vismach.py'.

 

Attachment not found



to this (sets the background to (r,g,b)=(0.5,0.1,0.3) :

        (self.r_back, self.g_back, self.b_back) = (0.5,0.1,0.3)

Result:

 

Attachment not found

Please Log in to join the conversation.

More
3 years 1 month ago #279948 by zz912
It works. Thank you.

Can I ask you for change blue (or purple) color on white parts?



 

Please Log in to join the conversation.

More
3 years 1 month ago #279957 by Aciera
Part color in vismach is defined in the model file, some examples are:

tool = Color([1,0,0,0], [tool] )

rot_point_set = Collection([
Color([1,0.8,0,1],[CylinderX(-5,0.2,5,0.2)]),
Color([1,0.8,0,1],[CylinderY(-5,0.2,5,0.2)]),
Color([1,0.8,0,1],[CylinderZ(-5,0.2,5,0.2)])
])

If no color is defined the part defaults to white (I think) so you may have to add the Color definitions yourself. If you need help then please post the model file.

[edit]
syntax is  Color([red,green,blue,alpha],[<your_part>])
Note that 'alpha' seems broken, so it's value is ignored.

Please Log in to join the conversation.

More
3 years 1 month ago #279971 by zz912
You dont understand me.

My color of parts is white:

a_kryty = Color([1,1,1,1],[a_kryty])

But in visualization it has blue (or purple) "shadow".

Look at:
linuxcnc-2.9/configs/sim/axis/vismach/scara/scara.ini

Please Log in to join the conversation.

More
3 years 1 month ago #279985 by Aciera
Ah, I see. Yes you can adjust that in these lines of 'vismach.py':

 

Attachment not found



I haven't tried them all but if you change line 790 to this:

        glLightfv(GL_LIGHT0+1, GL_DIFFUSE, (.4,.0,.0,0))

You will change the blue to a red shadow. (So adjust to your needs)

[edit]
Note there are two diffuse light sources ('GL_LIGHT0' and 'GL_LIGHT0+1') so you may have to adjust both.

Please Log in to join the conversation.

More
3 years 1 month ago #280059 by zz912
Thank you, thank you.

        glLightfv(GL_LIGHT0, GL_DIFFUSE, (0.9,0.9,0.9,0))

        glLightfv(GL_LIGHT0+1, GL_DIFFUSE, (0.9,0.9,0.9,0))

White is white:
 

Attachment not found





 

Please Log in to join the conversation.

Time to create page: 0.112 seconds
Powered by Kunena Forum