Objekt in Richtung eines anderen Objektes rotieren

4 years 5 months ago - 3 years 1 week ago #12 by Jules Dreki


  • Posts: 3

  • Gender: Unknown
  • Birthdate: Unknown
  • Ein Problem das man in LSL/OSSL zum Glück nicht "zu Fuss" mit Vektor-/Matrizenrechung und der Eulerschen Drehmatrix lösen
    muß. Die folgende URL erklärt das sehr schön, wie einfach sich das lösen lässt. :-)

    www.virtualverse.one/forums/threads/kept...-another-object.178/

    Codeschnipsel:
    vector SF_spos = <x,y,z>; //start position
    vector SF_epos = <x,y,z>; //end position
    
    float fDistance = llVecDist(<SF_epos.x,SF_epos.y,0>,<SF_spos.x,SF_spos.y,0>;);//XY Distance
    rotation rotZ = llRotBetween(<1,0,0>,llVecNorm(<fDistance, 0, SF_epos.z - SF_spos.z>;));//up/down rotation
    rotation rotXY = llRotBetween(<1,0,0>,llVecNorm(<SF_epos.x - SF_spos.x,SF_epos.y - SF_spos.y,0>;));//left/right rotation
    rotation absRot = rotZ*rotXY; //absolute rotation
    llSetRot(absRot);


    Möchte man statt dem Befehl llSetRot() lieber llSetKeyframedMotion() benutzen ist noch ein Schritt notwendig. Anders als llSetRot() erwartet llSetKeyframedMotion() relative Parameter.

    rotation relRot = absRot/llGetRot();
    llSetKeyframedMotion( [
    <0.0, 0.0, 0.0>, relRot, 1.0
    ], );
    Last edit: 3 years 1 week ago by Jules Dreki.

    Please Log in or Create an account to join the conversation.

    Time to create page: 0.126 seconds
    Powered by Kunena Forum

    How do I get in?

    If you want to log into the Swiss Grid, you first need a so-called viewer.

    B. the Firestorm. Download here:

    Firestorm Viewer für Opensim

    Download ---> then install ----> then open

    In the example here, the so-called “Phoenix mode” was selected in the viewer. But it works the same in any other mode; don't let the viewer version irritate you either. The login to the Swiss grid also works the same way with every new version.

    It is important that you only download the version for the Opensim (OS). Inworld problems can occur with combination viewers for SL and OS.



     

    Registration steps according to the picture:

    1 Click Viewer in the menu above, then Settings,

    2 Click on the OpenSim tab

    3 Enter the following address in the field: http://swissgrid.opensim.ch:8002/ (copy & paste)

    4 Click Apply

    5 Click OK

    6 Enter your user name (user name that is exactly the same as the login name on the Swissgrid homepage!)

    7 Enter your password (password exactly the same as the login name on the Swissgrid homepage!)

    8 Select Swiss Grid (now you should see the background image as shown above - then you are correct)

    Now click the login button (9) and your new avatar will automatically be taken to the welcome region.

    A little hint: the @ (and gridname) after the username is automatically generated by the viewer.

    You only need to enter your username there.


    We have 1014 guests and no members online


    swissgrid.opensim.ch

    © Swissgrid 2018-2022 Impressum:
     Admin: Night Raven    Sili Gal
         CH-8952 Schlieren/ZH