image thumbnail

Animate a Wind Farm with MATLAB: Adding Realism

by

 

Realism added to the demo

wind_turbine_code_realism.m
world=vrworld('Wind_Turbine_Realism.wrl', 'new');
open(world);
fig=vrfigure(world);
set(fig, 'Headlight', 'off');

blades_1=vrnode(world, 'Blades_1');
blades_2=vrnode(world, 'Blades_2');
blades_3=vrnode(world, 'Blades_3');

phase_1=0;
phase_2=pi/3;
phase_3=pi/6;

for theta=0:0.25:12*3*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];
    vrdrawnow;
end

Contact us