きょうの Second Life をひとつの場所で ギフトとフリービー を毎時間更新 7言語 無料 でお店を掲載
グリッド障害
  • 予定: Scheduled Billing Maintenance, 11月16日(月) 09:30–10:30 SLT
  • グリッド状況: Unscheduled Group Chat Maintenance (investigating)
  • 開催中: UUtopiaのUnitarian Universalist土曜礼拝
  • 開催中: The Dharma of Community: 仏教社会と在家の生き方
  • 開催中: SLCSハーベストフェスト:ゲーム、音楽、お楽しみ
  • 14:00 SLT: Cascadiaのムーンダンスで NAD GOUGH ライブ 14:00 SLT
  • ニュース: REZZ MALL: Second Lifeのブランドが集まるウェブモール
  • Viewer: Second Life Viewer 26.5 チャットを刷新
  • 予定: Scheduled Billing Maintenance, 11月16日(月) 09:30–10:30 SLT
  • グリッド状況: Unscheduled Group Chat Maintenance (investigating)
  • 開催中: UUtopiaのUnitarian Universalist土曜礼拝
  • 開催中: The Dharma of Community: 仏教社会と在家の生き方
  • 開催中: SLCSハーベストフェスト:ゲーム、音楽、お楽しみ
  • 14:00 SLT: Cascadiaのムーンダンスで NAD GOUGH ライブ 14:00 SLT
  • ニュース: REZZ MALL: Second Lifeのブランドが集まるウェブモール
  • Viewer: Second Life Viewer 26.5 チャットを刷新
LSLスクリプト

LSL rotate script: smooth spinning object

Free LSL rotation script for Second Life: make signs, fans, wheels and display stands spin smoothly, choose axis and speed, touch to start and stop.

31行 ·

A spinning sign or turning product stand catches the eye. This rotate script uses smooth client-side rotation: each viewer draws the spin itself, so it looks fluid and puts almost no load on the region.

lsl-rotate-script.lsl · 31行 このスクリプトをチェック
// Smooth Rotation (spin) - free LSL script from WhatSL (https://whatsl.com/scripts/lsl-rotate-script)
// Free to use, change and put in your own creations, also ones you sell.
//
// Makes the object spin smoothly, for example a sign, a fan or a display stand.
// The spin is drawn by each viewer, so it costs the region almost nothing.

vector  SPIN_AXIS    = <0.0, 0.0, 1.0>;  // <0,0,1> = turn around the up axis like a turntable
float   SPIN_SPEED   = 0.5;              // radians per second; a negative number turns the other way
integer TOUCH_TOGGLE = TRUE;             // TRUE = touch to start and stop

integer gOn = TRUE;

spin(integer on)
{
    if (on) llTargetOmega(SPIN_AXIS, SPIN_SPEED, 1.0);
    else llTargetOmega(SPIN_AXIS, 0.0, 0.0);
    gOn = on;
}

default
{
    state_entry()
    {
        spin(TRUE);
    }

    touch_start(integer total)
    {
        if (TOUCH_TOGGLE) spin(!gOn);
    }
}

自由に使用・改変でき、販売する作品にも組み込めます。

How to set it up

  1. Put the script in the object you want to spin and save. It starts turning right away.
  2. Change SPIN_AXIS if it turns the wrong way round, and SPIN_SPEED to make it faster or slower.
  3. With TOUCH_TOGGLE on, touch the object to stop or start it.

Settings

  • SPIN_AXIS: the axis to turn around. <0,0,1> turns like a turntable, <1,0,0> rolls like a wheel, <0,1,0> flips forwards.
  • SPIN_SPEED: radians per second. 0.5 is a calm turn, 3.0 is fast. Negative numbers turn the other way.
  • TOUCH_TOGGLE: TRUE lets visitors stop and start the spin by touching it.

Tips

  • In a linked object, put the script in a child prim to spin only that part, such as fan blades or a wheel.
  • Because each viewer draws the spin, different people can see the object at a slightly different angle. That is normal.

Frequently asked questions

Why does the object jump back when I edit it?

Smooth rotation is only drawn by viewers; the object's real rotation does not change. When you edit it, you see its real rotation.

How do I stop the spin for good?

Set SPIN_SPEED to 0.0 and save, or touch it with TOUCH_TOGGLE on, then delete the script.

Does it work on physical objects?

This script is meant for normal, non-physical objects such as signs and decorations.

自分のスクリプトをチェック: LSL構文チェッカー →

ほかのスクリプトすべてのスクリプト
LSLスクリプト · 55行

LSLのドアスクリプト:タッチで開閉し、自動で閉まる

Second Life用の無料LSLドアスクリプトです。ドアをタッチすると蝶番を軸に開き、もう一度タッチするか数秒後に自動で閉まります。閉じた位置を覚えるので、後からドアを動かしても問題なく動作し、効果音も設定できます。

LSLスクリプト · 69行

LSL sit and pose script for chairs and pose balls

Free LSL sit script for Second Life chairs, benches and pose balls: sit and play your own animation, set the sit position, hide the ball while in use.

LSLスクリプト · 96行

LSL tip jar script with thank-you message and total

Free LSL tip jar script for Second Life clubs, DJs, hosts and stores: quick pay buttons, a thank-you message, the total and last tipper in floating text.