image thumbnail

Animate a Wind Farm with MATLAB: Add the Fog Effect

by

 

More realistic rendering of the wind farm scene on an early morning.

wind_turbine_code_fog.m
world=vrworld('Wind_Turbine_Fog.wrl', 'new');
open(world);
fig=vrfigure(world);

blades_1=vrnode(world, 'Blades_1');
blades_2=vrnode(world, 'Blades_2');
blades_3=vrnode(world, 'Blades_3');
fog=vrnode(world, 'Fog_Morning');
a=fog. visibilityRange;
phase_1=0;
phase_2=pi/3;
phase_3=pi/6;

for theta=0:0.25:60*pi
    pause(0.001)
    blades_1.rotation=[0 0 1 phase_1-theta];
    blades_2.rotation=[0 0 1 phase_2-theta];
    blades_3.rotation=[0 0 1 phase_3-theta];
    fog. visibilityRange=a+40*sin(0.05*theta);
    vrdrawnow;
end

Contact us