Wish - Vismach change background color

  • zz912
  • zz912's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
05 Sep 2023 10:26 #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 or Create an account to join the conversation.

More
05 Sep 2023 11:16 #279942 by Aciera
Replied by Aciera on topic Wish - Vismach change background color
I'm not a developer but if you need a quick fix you can change line 774 in 'vismach.py'.

 

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:

 
Attachments:
The following user(s) said Thank You: tommylight, zz912

Please Log in or Create an account to join the conversation.

  • zz912
  • zz912's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
05 Sep 2023 12:02 #279948 by zz912
Replied by zz912 on topic Wish - Vismach change background color
It works. Thank you.

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



 

Please Log in or Create an account to join the conversation.

More
05 Sep 2023 12:38 - 05 Sep 2023 12:43 #279957 by Aciera
Replied by Aciera on topic Wish - Vismach change background color
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.
Last edit: 05 Sep 2023 12:43 by Aciera.
The following user(s) said Thank You: zz912

Please Log in or Create an account to join the conversation.

  • zz912
  • zz912's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
05 Sep 2023 13:43 #279971 by zz912
Replied by zz912 on topic Wish - Vismach change background color
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 or Create an account to join the conversation.

More
05 Sep 2023 15:05 - 05 Sep 2023 15:11 #279985 by Aciera
Replied by Aciera on topic Wish - Vismach change background color
Ah, I see. Yes you can adjust that in these lines of 'vismach.py':

 

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.
Attachments:
Last edit: 05 Sep 2023 15:11 by Aciera.
The following user(s) said Thank You: zz912

Please Log in or Create an account to join the conversation.

  • zz912
  • zz912's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
06 Sep 2023 06:27 #280059 by zz912
Replied by zz912 on topic Wish - Vismach change background color
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:
 



 
Attachments:
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.120 seconds
Powered by Kunena Forum