Change axis point

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Change axis point

Americo Damasceno-3
You don't need to change any axis to do  a pivoting door. You need to create two parts of the door. The first will have only the dimensions to be the "axis".The second will be the "real" door. Linking this one with the first, you can add this script to the object:

 integer open;
 rotation rotActual ;
 rotation rot ;
 vector iniPos;

 default{
 
 state_entry(){
  
   iniPos=llGetPos();
  
   if(iniPos.y<140){ // y of the door closed
     open = 0;
   }
  else open=1;
  
 }
 touch_start(integer i){
   if(open==0){
  
   rotActual = llGetRot();
   rot = llEuler2Rot(<0,0,-90>*DEG_TO_RAD);
   llSetRot(rotActual*rot);
   llSetPos(llGetPos());
   open=1;
   iniPos=llGetPos();
   
 }
  else{
  
  rotActual = llGetRot();
   rot = llEuler2Rot(<0,0, 90>*DEG_TO_RAD);
  llSetRot(rotActual*rot);
   llSetPos(llGetPos());
  open=0;
  iniPos=llGetPos();
   //llOwnerSay((string)iniPos.y);
  }
 }
}

You can see this solution working on my sim at  http://200.207.267.61:9000, using the userID: Guest One, pw:123456
There are some other scripts there. 

_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Change axis point

Marc Adored
You can also make the prim double the width and cut it in half putting
the axis to the edge then rotate. This in my experience works more
reliably then other methods.

On Tue, Nov 10, 2009 at 5:48 AM, Americo Damasceno <[hidden email]> wrote:

> You don't need to change any axis to do  a pivoting door. You need to create
> two parts of the door. The first will have only the dimensions to be the
> "axis".The second will be the "real" door. Linking this one with the first,
> you can add this script to the object:
>  integer open;
>  rotation rotActual ;
>  rotation rot ;
>  vector iniPos;
>  default{
>
>  state_entry(){
>
>    iniPos=llGetPos();
>
>    if(iniPos.y<140){ // y of the door closed
>      open = 0;
>    }
>   else open=1;
>
>  }
>  touch_start(integer i){
>    if(open==0){
>
>    rotActual = llGetRot();
>    rot = llEuler2Rot(<0,0,-90>*DEG_TO_RAD);
>    llSetRot(rotActual*rot);
>    llSetPos(llGetPos());
>    open=1;
>    iniPos=llGetPos();
>
>  }
>   else{
>
>   rotActual = llGetRot();
>    rot = llEuler2Rot(<0,0, 90>*DEG_TO_RAD);
>   llSetRot(rotActual*rot);
>    llSetPos(llGetPos());
>   open=0;
>   iniPos=llGetPos();
>    //llOwnerSay((string)iniPos.y);
>   }
>  }
> }
> You can see this solution working on my sim at  http://200.207.267.61:9000,
> using the userID: Guest One, pw:123456
> There are some other scripts there.
> _______________________________________________
> Opensim-users mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/opensim-users
>
>
_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users