Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Spin and Rotate at same time

2fast4u Nabob
SL-ice.net
Join date: 28 Dec 2005
Posts: 542
10-18-2008 14:45
Hi,

I am trying to make a wind turbine that faces into the wind as the SL wind changes.

I have no problem getting the wind angle, rotating to face the wind, etc. Works perfectly.

The problem I have is with the spinning blades. I am using llTargetOmega to spin a link set - the root prim's rotation is ZERO_ROTATION. So, I'm using llTargetOmega to get the link set spinning about it's X axis (maybe Y - I don't have the script with me now.

The problem occurs when I try to combine the call to llSetRot to turn the spinning blades while the link set is already spinning using llTargetOmega (so, rotating the link set on the Z axis - into the wind). The moment I call llSetRot, the link set tilts and gets really messy. I have messed with using llAxisAngle2Rot, llSetRot, etc - no luck.

I think I need to somehow combine the rotation I am setting in lSetRot with llTargetOmega, but have no idea how to do that. I think things will appear choppy when I call llTargetOmega with the new rotation (if that's how to do it), so I'll check for a new wind direction every few minutes (instead of more often like a wind vein).

I found a tutorial where someone makes a windmill, but that's not much help since I run into the same problems. Besides, my setup is a lot simpler than the windmill in the tutorial since I only need to rotate one linkset (the tutorial rotated a couple of link sets).

Would appreciate some help! Thanks -2fast
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
10-18-2008 16:37
I've seen it done, I know it requires updated calls to target omega, and it may require you to build your root on a specific axis to get it to play nice... past that memory fails me...
_____________________
|
| . "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...
| -
AnnMarie Otoole
Addicted scripter
Join date: 6 Jan 2007
Posts: 162
10-18-2008 21:12
I solved the problem (kinda) by rezzing a new rotating item at the new position while llDie()ing the old one.
2fast4u Nabob
SL-ice.net
Join date: 28 Dec 2005
Posts: 542
Got it working
10-19-2008 13:24
Hi -

Thanks for the replies. I got it working.

In case you are interested, you need to adjust the first parameter to llTargetOmega to get this to work. Calling llTargetOmega to readjust the spin looks choppy for a moment, but everyone else that makes these type of things seems to have the same problem.

-2fast