Hey, I searched some time but I didn´t quite find something to match for me.
I´m trying to make a day and night system and I have everything setup, exept the mist.
At night the mist should change to black and at day again to blueish.
I have a property setup which represents the time of day.
My question is:
How can I make the mist change color, and how to change it dynamically depending on the time property.
You can directly change the property values in the object running the script, but it is probably better to use python to allow finer control.
It really isn’t hard. To set the color you can use:
import mist
mist.setColor([0,0,1]) #[r,g,b]
So what are you planning to have drive the mist? What should change it’s color/depth?
I have a property setup which counts from 0-1200. This controls the lamps, skydome and everything else
Now this should also control the mist density/color.
The problem is that 0-1200 is a complete day+night cycle.
So the mist should increase in density till 600 (midnight) and decrease afterwards again.
Same goes to the color which should turn to black till 600 and back to white till 1200.
The proper way to do it is to build a mathematical model: draw out the curves you want, and then express them algebraically (eg peicewise function or fourier series). Then you can use the value of the property as an input to the function, and get the color out. But this takes a lot more work.