Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

To Start: What is it called?

Holocluck Henly
Holographic Clucktor
Join date: 11 Apr 2008
Posts: 552
06-12-2008 07:42
I cannot find information on what I want to do.

How does one move a prim? Not as in rotation or position but as in scripting it to change its shape in a controlled cycle. I want to be able to take a cylinder or cube and sheer it in a certain way, then have it slowly change those parameters so it sheers another way, then back to the first way, etc.

I see morphing sculptures all the time. How can something like this be done?

Just to find out what it is called and how to script the manipulation is a great start.

Thanks and please answer as though you're speaking to a total dummy. Well, not total...
Shifting Dreamscape
Always questioning ...
Join date: 12 Dec 2007
Posts: 266
06-12-2008 07:49
Using the function llSetPrimitiveParams() .. check it out on the Wiki (http://wiki.secondlife.com/wiki/LlSetPrimitiveParams)
Atom Burma
Registered User
Join date: 30 May 2006
Posts: 685
06-12-2008 07:49
This script is set to the main chat channel, just tell it what shape you want, it will switch. You can mod it to a timer, whatever.


default
{
state_entry()
{
llSetStatus(STATUS_PHANTOM, TRUE);
llListen(0, "", NULL_KEY, "" );

}

on_rez(integer num)
{
llResetScript();
}

listen(integer number, string name, key id, string message)
{
list mypar = llGetPrimitiveParams([PRIM_SIZE,PRIM_TYPE]);
if(message=="box";)
{
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]);

}
if(message=="cylinder";)
{
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]);
}
if(message=="sphere";)
{

llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>]);
}
if(message=="prism";)
{
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_PRISM, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <0.0, 0.0, 0.0>, <0.0, 0.0, 0.0>]);
}
if(message=="torus";)
{

llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_TORUS, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.25, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 1.0, 0.0, 0.0]);;
}
if(message=="tube";)
{

llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_TUBE, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.25, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 1.0, 0.0, 0.0]);
}
if(message=="ring";)
{

llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_RING, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.25, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 1.0, 0.0, 0.0]);
}
if(message=="cone";)
{

llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <0.0, 0.0, 0.0>, <0.0, 0.0, 0.0>]);
}



}

}
Holocluck Henly
Holographic Clucktor
Join date: 11 Apr 2008
Posts: 552
06-12-2008 11:12
Thanks. Looking at the list on wiki, what would be the difference between physical and flexible? I thought flexible was where you set the physical parameters of a prim.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
06-12-2008 11:43
From: Holocluck Henly
Thanks. Looking at the list on wiki, what would be the difference between physical and flexible? I thought flexible was where you set the physical parameters of a prim.


Physical and Flexible are both primitive parameters that can be set. Physical relates to the physics engine. When set true, the object will respond to gravity, wind, and forces applied to the prim. Make a prim, and raise it into the air, it'll be non-physical by default. edit it, select the object tab, and click the physical checkbox, then close the edit window, and you'll see gravity pull the prim to the ground.

Flexible is a proper that certain prims, but not all, can have that enable it to be exactly that, flexible. You see flexible prims in action all the time in SL. Flags, hair, prim dresses, capes, etc. The property of a prim to bend, (and also react to forces like wind). open the features tab, and check the flexible checkbox, then drag the prim around to see the effect of flexible on a prim.



http://secondscripter.com/
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Holocluck Henly
Holographic Clucktor
Join date: 11 Apr 2008
Posts: 552
06-13-2008 01:08
I'm curious how one could apply morphing to one or two parameters of a single prim type vs changing prim shapes. How do the bracketed numbers correspond with the prim's object settings? What would control the speed of the change and transition to another instead of breaking it up with commands?
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
06-13-2008 02:25
From: Holocluck Henly
I'm curious how one could apply morphing to one or two parameters of a single prim type vs changing prim shapes. How do the bracketed numbers correspond with the prim's object settings? What would control the speed of the change and transition to another instead of breaking it up with commands?

It looks to me as if you want to take a short cut here. What you ask involves many disciplines in LSL. Why not take one step at a time? You could start by taking a closer look at Atom's script.
If you don't have time for learning LSL the only way out is to get a ready made script to morph your prims
_____________________
From Studio Dora
Holocluck Henly
Holographic Clucktor
Join date: 11 Apr 2008
Posts: 552
06-13-2008 04:32
I want to understand the parameters of the script. I am asking about all the zeroes. I think that doesnt mean I want something ready made. And I DO want a cycle. For one who guides and books have proven useless, I need someone who will explain these things and how to approach something so I can make my own script. It's been something I've posted over and over about.

Try searching for moving a prim and see what you get. You wont get this.

So... is there a clear and concise break down of every one of those brackets somewhere that a BEGINNER can learn which attribute of the prim is represented in which? AND can one put numbers above or below the limitations of some (for example path cut) when you hand script it? Thanks!
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
06-13-2008 06:15
From: Holocluck Henly

So... is there a clear and concise break down of every one of those brackets somewhere that a BEGINNER can learn which attribute of the prim is represented in which? AND can one put numbers above or below the limitations of some (for example path cut) when you hand script it? Thanks!


Yes...

http://wiki.secondlife.com/wiki/LlSetPrimitiveParams
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Holocluck Henly
Holographic Clucktor
Join date: 11 Apr 2008
Posts: 552
06-13-2008 06:57
DOH

I didnt scroll down. Thanks!
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
06-13-2008 07:01
Several things here. First, a lot of the "morphing" prims that one sees these days are sculpties using a sequence of sculptmaps. Also, there are a lot of (usually non-sculpty) prim assemblies that change the individual prim positions and rotations as if animated, often using a commercial script called "Puppeteer" (or something like that--I've never used it; I assume it works like my homegrown versions and can record and playback all the other prim properties, too, not just pos & rot).

As noted, these approaches use llSetPrimitiveParams() if each changing prim is individually scripted, or llSetLinkPrimitiveParams() for controlling multiple linked prims from a single scripted prim. (Well, almost all. Parcel media can drive a sculptmap, but that's not likely to be a helpful complication at this point.) Note that these functions delay the script 0.2 sec per call. To get greater smoothness, this delay can be gotten around by having multiple slave scripts running in parallel. And yes, an object doing a lot of this will lag other scripted objects and vice versa... and since this is actually affecting prim geometry that has to be pushed to each agent's client, it has some additional performance impact on the sim and the viewers. This isn't something to fret too much over for a single scripted object, but if you're managing a sim full of Puppeteered steam equipment, say, things may get a little sticky.
_____________________
Archived for Your Protection