Aker Dassin
Registered User
Join date: 20 Jul 2005
Posts: 4
|
07-21-2005 14:27
[obligitory]I'm new at this[/obligatory]
I am trying to make a script that causes the object its attached to to rotate slowly around the Z axis. I want the object to stay in place and rotate around its centre of gravity.
Having looked around I think I need to lock the X and Y axis for rotation. doing this and using llSetTorque on a flat surface I can get something thats almost right. Except it tends to slide around alll over the place. So I have to questions.
1. How do I pin the x/y/z co-ords and the x/y rotation and leave the Z rotation under the control of my script.
2. How do I get this to work on uneven surfaces, I just want it to clip straight through the ground for the moment.
Any help would be appreciated.
Thanks
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
07-21-2005 15:01
You want to have a look at llTargetOmega(). 
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
07-21-2005 15:31
alternatively grab the starting position and move to target.
|
Aker Dassin
Registered User
Join date: 20 Jul 2005
Posts: 4
|
07-22-2005 05:10
I rewrote it to use targetomega but im still having some problems basic description I have 4 boxes one on top of each other (ABCD) B,C,D are all linked to A and rotate on the Z axis. A sits on the bottom. A has a touch script that sends a message to B, C, D to start or stop them rotating (all go at different speeds and directions). It kinda works. When its all stopped and I click 1 of the following happens: 1. Nothing 2. The entire unit (ABCD) turns about 10 degrees in one direction then snaps back and stops 3. Everything starts up fine 4. one or two of the units (out of BCD) start but the rest dont. When all are moving then clicking does one of: 1. Nothing 2. All stop 3. One or two stop I did read about a problem with llTargetOmega not sending data to the client which could be worked around with a command like: llSetAlpha(llGetAlpha(0)); Which has no net effect but does cause a flush to the client. I have this bit of code called after each change to llTargetOmega. I realise this object is fairlly useless in general but Its a learning thing  Anyone got any ideas whats causing the eratic beahviour or a way round it. Ideally i'd like to do the rotation at a constant rate server side but that doesnt apear possible.
|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
07-22-2005 08:10
Aker, I'm not sure, but Jillian had ever said to me, "On occasion, something goes "wonky" with linked prims. You can also try to shift-drag a copy into existance and see if that one behaves better." And I got a great result. What about trying to just copy it because it is so easy and you have nothing to lose?
_____________________
 Seagel Neville 
|
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
|
07-22-2005 08:35
Might help if we could see the code as well 
_____________________
---------------------------------------------------------- --The mind's eye is limited only by its focus--
|
AcidRaven Harrington
Linux User
Join date: 18 Jun 2005
Posts: 86
|
07-22-2005 11:53
Also you should not need to rotate any of the prims but he root object. Linked objects will stay in the same position in relation to the root object as it rotates. A actuly don't know what would happen if you rotated a non root object (thinks about going to test it out) I made a mary-go-round that works realy nice (one of the best people have seen so far) and I just rotate the root prim (the base) beucse it's center is the center of the marry-go-round. Now if I deside to change the base (like section it up so I can have diffrent Sit scripts in each pice) I will likely have to move the rotation to somewhere else so that that prims center is the center of the object for rotation. later
_____________________
Acidraven Harrington Child Avatar Height detector 1.0.4: AcidRaven Harrington is 1.191803 m (3 feet 11 inches) tall. (counting your shoes)
Yo, ho, haul together, hoist the Colors high… Heave ho, thieves and beggars, never say we die. Freedom is for Everyone. http://www.gopetition.com/petitions/full-reign-of-self-expression-for-consenting-adults-in-second-life.html
|
Rayve Mendicant
Scripts for L$5 billion
Join date: 12 Mar 2005
Posts: 90
|
07-22-2005 15:01
he's not looking to rotate the children with the root, he wants them at varying speed and such. The control object: default { touch_start(integer total_number) { llMessageLinked(LINK_SET,-1,"rotate",""); } } Object B: integer rot = FALSE; integer number = -1; default { link_message(integer sender, integer int, string str, key id) { if (str == "rotate" && rot == FALSE) { llTargetOmega(<0,0,1> * llGetLocalRot(),PI/4,1); rot = TRUE; } else if (str == "rotate" && rot == TRUE) { llTargetOmega(<0,0,0> * llGetLocalRot(),0,0); rot = FALSE; } } }
Object C: integer rot = FALSE; integer number = -1; default { link_message(integer sender, integer int, string str, key id) { if (str == "rotate" && rot == FALSE) { llTargetOmega(<0,0,1> * llGetLocalRot(),-TWO_PI,1); rot = TRUE; } else if (str == "rotate" && rot == TRUE) { llTargetOmega(<0,0,0> * llGetLocalRot(),0,0); rot = FALSE; } } }
Object D: integer rot = FALSE; integer number = -1; default { link_message(integer sender, integer int, string str, key id) { if (str == "rotate" && rot == FALSE) { llTargetOmega(<0,0,1> * llGetLocalRot(),PI,1); rot = TRUE; } else if (str == "rotate" && rot == TRUE) { llTargetOmega(<0,0,0> * llGetLocalRot(),0,0); rot = FALSE; } } }
mess with the values for llTargetOmega to get varied rotational effects
_____________________
_______________________ Rayve Mendicant Second Evolution "Darwin ain't got nothin' on this"
|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
07-23-2005 06:20
Hmm... I made sure this was weired. Is this a famous llTargetOmega issue? See this thread.  Was I involved? Oh, no, it was worse when I asked. It became better... Something seemd to be changed. Refert to articles in April later. Sorry for not helping.
_____________________
 Seagel Neville 
|