Let's create a drone in edMondo!
-
Serbian partners build the different part of drone in edMondo, share their work in twinspace where they discuss with partners
-
Italian partners animate it with script in edMondo. They share their activities in twinspace and discuss with other partners
At work!
The script to animate a drone by class IV A ITE "Marconi-Guarasci" Rogliano (Cs) Italy
Unfortunately the connection does not allow the whole class to access we have worked only with the LIM, but the result was still exciting!
rotation delta;
rotation rot;
integer handle;
default
{
state_entry()
{
handle=llListen(30,"",NULL_KEY,"");
}
touch_start(integer total_number)
{
key id=llDetectedKey(0);
llDialog(id,"Inizia a gestire i movimenti:X+1 significa che incrementa di un metro la coordinata X,
mentre -30°z indica una rotazione attorno all'asse z di 30°in senso orario", ["X+1","Y+1","Z+1","X-1","Y-1","Z-1","30°x","-30°x","30°y","-30°y","30°z","-30°z"],30);
}
listen(integer channel, string name, key id, string str)
{
llListenRemove(handle);
vector position = llGetPos();
rotation rot = llGetRot();
if(str=="X+1") { llSetPos( llGetPos() + < 1, 0,0 > );}
if(str=="Y+1") { llSetPos( llGetPos() + < 0,1,0 > );}
if(str=="Z+1") { llSetPos( llGetPos() + < 0, 0,1 > );}
if(str=="X-1") { llSetPos( llGetPos() + < -1, 0,0 > );}
if(str=="Y-1") { llSetPos( llGetPos() + < 0,-1,0 > );}
if(str=="Z-1") { llSetPos( llGetPos() + < 0, 0,-1 > );}
if(str=="30°x") { delta = llEuler2Rot (<30 * DEG_TO_RAD,0,0>);
rot = delta * rot;
llSetRot(rot);}
if(str=="-30°x") { delta = llEuler2Rot (<-30 * DEG_TO_RAD,0,0>);
rot = delta * rot;
llSetRot(rot);}
if(str=="30°y") { delta = llEuler2Rot (<0,30 * DEG_TO_RAD,0>);
rot = delta * rot;
llSetRot(rot);}
if(str=="-30°y") { delta = llEuler2Rot (<0,-30 * DEG_TO_RAD,0>);
rot = delta * rot;
llSetRot(rot);}
if(str=="30°z") { delta = llEuler2Rot (<0,0,30 * DEG_TO_RAD>);
rot = delta * rot;
llSetRot(rot);}
if(str=="-30°z") { delta = llEuler2Rot (<0,0,-30 * DEG_TO_RAD>);
rot = delta * rot;
llSetRot(rot);}
llResetScript();
}
}