Don't click here unless you want to be banned.

LSL Wiki : ButtonPusherJones

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are
bUTTONpUSHER Jones must conform to WakkaWiki capitalization. meh.

also, monkey.

Current project: PetProtocol

below is a collection of rotation scripts, aka "bp's bane"

// rotate texture to avatar's direction
    collision(integer num_detected)
        vector fDir = llRot2Euler(llDetectedRot(num_detected - 1));
        fDir.z -= PI_BY_TWO;
        llRotateTexture(fDir.z, 0);

Move a specific distance in some direction
Move a specific distance in some direction.
    touch_start(integer total_number)
        llSetStatus(STATUS_PHYSICS, TRUE); // make it physical so it will move

        // pick a random direction in the XY (ground) plane
        float z_angle = llFrand(360); // random degrees. 360 degrees is full circle
        vector eul = <0,0,z_angle>; // degrees around the z-axis, in Euler form
//        llOwnerSay("eul is " + (string)eul);
        eul *= DEG_TO_RAD; //convert to radians
        rotation quat = llEuler2Rot(eul); //convert to quaternion

        // move some distance in that direction
        vector offset_distance = <5,0,0>; // <5,0,0> means we want to move 5 meters.
        vector offset_position = offset_distance * quat; // find the position 5 meters in the direction we previously chose
//        llOwnerSay("offset_position is " + (string)offset_position);
        vector final_position = llGetPos() + offset_position; // add the offset position to the current position
//        llOwnerSay("final_position is " + (string)final_position);
        llMoveToTarget(final_position, 10); // move there over the next 10 seconds.
        // this could all be done in one line
//        llMoveToTarget((llGetPos() + <5,0,0>*llEuler2Rot(<0,0,llFrand(360)>*DEG_TO_RAD)), 10);


more rotations to illustrate
* how to transform right (or up, etc) to forward
* how to rotate around 1 axis to nearest lookat
* how to zero X and Y while keeping same Z rotation (how to rotate around 2 axes to nearest lookat?)
* how to rotate child prim around root prim
* how to rotate child prim around arbitrary point (this is a move and rotate)
* how to rotate child prim around it's own center
* how to rotate an arbitrary point of a child object (as an offset, eg. the top face of a box) around another arbitrary point
* get the rotation of the avatar
* get the rotation of the camera

Jasa SEO Jasa SEO Murah Sepatu Online Toko Sepatu Online Sepatu Sepatu Murah Sepatu Safety Sepatu Futsal Cheapes Hostgator Coupon Link Booking Televisori offerte Notebook Offerte Berita Terkini Internet Marketer Muda Internet Marketer Indonesia Portatile Apple RDAnet Lorks Karikatur Bisnis Modal Kecil Bisnis UKM Berita Terbaru Iklan Baris Jasa SEO Jasa SEO Murah SEO Indonesia Konsultan SEO SEO Belajar SEO Kursus SEO Kursus SEO Murah Jam Tangan Casio Jam Tangan Casio Jam Tangan Murah Jam Tangan Grosir Baju Terbaru Grosir Baju Baju Terbaru Grosir Baju Murah Bisnis Online Belajar SEO Kerupuk Kerupuk kulit Social Bookmark Dofollow Social Bookmark Kumpulan Puisi Kirim Puisi bola hantu Penumbuh Rambut Penumbuh Rambut timbangan WBC Wonogiri Jasa SEO Murah Jasa SEO Jam Tangan Murah
There are 2 comments on this page. [Display comments/form]