Forum

Color picker using Blend4web

19 June 2016 19:09
I need to implement an html color picker on a car so that the car changes color on button clicks.. can someone tell me how..
19 June 2016 21:23
Hello,
A solution depends on how you created the interface.

If the buttons are simple html elements with color defined in their style description, you can use something like this (button_elem is a sample name):
var color = button_elem.style.color

And then create RGB components from the color variable.

The last step is to apply color to the real 3D object using this method for simple materials or this method for node materials.
19 June 2016 22:09
what type of colour choice this one has then out of theses two methods?

https://www.blend4web.com/en/demo/car_configurator/
Visualization expert!
22 June 2016 19:31
Can one of you provide me with a demo please with a little bit source code so i can get a head start. Easier to implement as well..
23 June 2016 11:24
On the polo color configurator you can acces the JS file they use. I think that would be a good example.
Did you take a look? It's a bit complexe but you should be able to find the color related functions quite easaly !
23 June 2016 20:33

Reply to post of user LukeVideo
On the polo color configurator you can acces the JS file they use. I think that would be a good example.
Did you take a look? It's a bit complexe but you should be able to find the color related functions quite easaly !

well I did take a look and it short circuited my brain.. And i need to implement this thing..
24 June 2016 00:24
What is your knowledge of blend4web ?
Maybe you could start with a simple node setup I'm which you hide reveal different objects when you click on different objects. That may not be ideal but I could setup a node tree for you in a few minutes. But I suck at materials so I can't help you if you want something more complicated.
24 June 2016 11:09
Here is a quick demo of object substitution. If you need to do that with complexe object it might not be a good solution because it multiplies the number of objects in the scene…
25 June 2016 12:45
Luke are you talking about any of these files?

Namely is that the materialVaration.js?

I was just wondering how can we have a look at that specific .js file.

Visualization expert!
25 June 2016 12:50
I dnt know but surprisingly …!

I saw this polo page many times… 10-20 may be but today first time I noticed that the doors do open @ some clicking when zoomed inn ! ! !
sweet accident ! LOL

:D

Visualization expert!
 
Please register or log in to leave a reply.