Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Flexi with prim attached

Paladin Pinion
The other one of 10
Join date: 3 Aug 2007
Posts: 191
03-26-2008 13:34
Someone told me this was impossible but I thought I'd check. Imagine a string attached to a beam at the top and linked to a weight at the bottom. I want the string to be flexi and affected by wind, but when it sways, the weight at the end should remain attached and go with it.

Impossible?
April Looming
Frustrated SL Addict
Join date: 14 Nov 2007
Posts: 184
03-26-2008 14:45
I'm soooo dying to know the answer to this as well...
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
03-26-2008 15:07
Yep, it's impossible. Although not as impossible as some might think.

See, you could actually apply the same forumla (wind, flexi softness etc) to your weight in order to synchronize its movement to the flexi rope. But a user could totally mess this up by clicking on your flexi prim and your weight would then become out of sync with the rope.


A better approach:

You could script the weight to move around independently with a motion that makes it appear as though it's on the end of some rope, then and have the flexi rope constantly point at it.
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
03-26-2008 15:24
Oh! and btw, I've actually created a weight on the end of some rope before. But I attached the weight to a long thin prim (rope) and made sure its center of axis was at the pivot point of the rope. You can balance things out by adding invisible prims. You then make the whole thing a vehicle and bingo..

This method is easier than the flexi approach and requires far less scripting. The sim's physics engine takes care of all the movement. You just give your vehicle a nudge now and then to keep it swinging..


I'm the king of the swingers..
April Looming
Frustrated SL Addict
Join date: 14 Nov 2007
Posts: 184
03-26-2008 17:59
I was thinking about applying this to clothing, to have dangling trinkets on the end of dance silks. It is possible when you make the whole thing a vehicle to attach it to your av and still have it work?

Also, 2k, you're a god... ;)
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
03-26-2008 19:14
I'm not 100% sure, but you may be able to fake this using the hollow for the rope, and a mostly transparent outside with a texture at the bottom..

I know flexi's are bad for holding centain cuts, but IIRC hollow will hold.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
03-27-2008 06:53
From: April Looming
I was thinking about applying this to clothing, to have dangling trinkets on the end of dance silks. It is possible when you make the whole thing a vehicle to attach it to your av and still have it work?



Nah, you can't attach vehicles to your av. Instead you'd have to attach some flexi prims (silks) to your avatar and have them say their global position on a private channel. The trinket vehicles would listen in on this channel and seek the positions. In turn the flexi prim threads would track the trinkets and make their flexi end meet the trinkets.

Well it works in theory...

Just don't come dancing near me in a laggy sim. I don't want an eye removed by a stray trinket.
April Looming
Frustrated SL Addict
Join date: 14 Nov 2007
Posts: 184
Lol!
03-27-2008 13:22
From: 2k Suisei

Just don't come dancing near me in a laggy sim. I don't want an eye removed by a stray trinket.


Aw come on... you've got a spare... ;)
Paladin Pinion
The other one of 10
Join date: 3 Aug 2007
Posts: 191
03-27-2008 13:41
There are some good ideas here. I'm interested in trying some of it. Would it be possible to determine where in space the flexi end is? I've looked at llGetPos and llGetBoundingBox and neither of these change while the rope sways. If I want to move a weight to the end of the rope, how would I determine where the end is?

I know this is a little backward from what was suggested, but curious if it is possible since it might be easier to implement. If it isn't, I'll try moving the weight instead. When the rope "looks at" the weight, will the end automatically position itself correctly? Seems like there would be more to it than that.
Paladin Pinion
The other one of 10
Join date: 3 Aug 2007
Posts: 191
03-27-2008 14:53
From: 2k Suisei

You could script the weight to move around independently with a motion that makes it appear as though it's on the end of some rope, then and have the flexi rope constantly point at it.


I tried this too but it isn't working. LlLookAt does point the end toward the target, but the rope rotates around its center to do that, which detaches the top from the beam. Is there a way around that? How did you keep the rope attached at the top?
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
03-27-2008 15:45
From: Paladin Pinion
There are some good ideas here. I'm interested in trying some of it. Would it be possible to determine where in space the flexi end is? I've looked at llGetPos and llGetBoundingBox and neither of these change while the rope sways. If I want to move a weight to the end of the rope, how would I determine where the end is?


Well no, this is what I've been saying, it's difficult to track the end of the rope. So instead you track the weight and then set the end of the rope to the same position of the weight. :)
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
03-27-2008 15:50
From: Paladin Pinion
I tried this too but it isn't working. LlLookAt does point the end toward the target, but the rope rotates around its center to do that, which detaches the top from the beam. Is there a way around that? How did you keep the rope attached at the top?


Okay, I'm sorry. I was assuming you knew how to set the flexi settings via script.

Take a look at llSetPrimitiveParams():

http://rpgstats.com/wiki/index.php?title=LlSetPrimitiveParams

You should see a section on flexi prim parameters in there. You'll need to set the flexi's force vector to set the position of the end of the flexi prim.
Paladin Pinion
The other one of 10
Join date: 3 Aug 2007
Posts: 191
03-27-2008 17:58
Thanks for your patience. Actually I do know how to use llSetPrimitiveParams, the problem is probably that I don't understand the physics. The wiki page refers to the params but doesn't really explain them very well. I looked at llSetForce and it just says it applies force (okay...) but I'm not sure how that would make the end of the rope stick to the beam.

I'm sure I need to play with this some more. The concepts in SL physics aren't too clear to me yet.
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
03-28-2008 03:49
These are the default parameters you can pass when using llSetPrimitiveParams:

[PRIM_FLEXIBLE, TRUE, 2, 0.3, 2.0, 0.0, 1.0, <0, 0, 0>]

The vector on the end is the force. You can set the end position of the flexi by setting that vector.
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
07-04-2008 08:40
From: 2k Suisei
These are the default parameters you can pass when using llSetPrimitiveParams:

[PRIM_FLEXIBLE, TRUE, 2, 0.3, 2.0, 0.0, 1.0, <0, 0, 0>]

The vector on the end is the force. You can set the end position of the flexi by setting that vector.

how do you do this? i've seen many references to making it point at a target, but i haven't seen any example scripts for this. i'm assuming it would be something like getting the target's positioon and applying the offset as the force? i might be completely wrong, but if that's right, no idea how to go about scripting it. i saw one script somewhere that uses sensors to randomly point at nearby avatars, but i was wondering how to get it to point at a specific link in the set, like in the ball on a rope example