I find a lot of door scripts and the like, and they rotate around the center of an object or prim.
Does anyone know of a way to rotate around the root prim on click, instead of around the center of the object?
These forums are CLOSED. Please visit the new forums HERE
Rotate around root prim? |
|
|
Paul Wardark
Wait, what?
Join date: 10 Jan 2009
Posts: 383
|
06-10-2009 13:54
I find a lot of door scripts and the like, and they rotate around the center of an object or prim.
Does anyone know of a way to rotate around the root prim on click, instead of around the center of the object? |
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
06-10-2009 14:26
Cut a box prim's path to begin at 0.375 and end at 0.875 then it will rotate from the edge.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum |
|
Rygel Ryba
Registered User
Join date: 12 Feb 2008
Posts: 254
|
06-10-2009 14:27
The coolest trick for a 1 prim door that you can link in and it will pivot around the edge is to play with the "Path Cut" function in the edit tools. You basically remove half of the prim and you'll see that center is now one edge (if you haven't moved the prim - your "door" will be laying down on the ground right now). Spin it up and put most any door script in and it should work - though you will need to play with the rotation numbers inside.
A prim, no matter what, will always spin on that little "X" the movement arrows make when you are in edit mode. An object will also rotate around the center of it's root prim. So with a two prim door - you make a very narrow prim (usually a cylinder but only because it is easier to visualize what is going to happen if you do it this way) and then link your "door" to it - or whatever else you want to have rotate. |
|
Basement Desade
Registered User
Join date: 14 Jul 2006
Posts: 91
|
06-10-2009 23:59
The coolest trick for a 1 prim door that you can link in and it will pivot around the edge is to play with the "Path Cut" function in the edit tools. You basically remove half of the prim and you'll see that center is now one edge (if you haven't moved the prim - your "door" will be laying down on the ground right now). Spin it up and put most any door script in and it should work - though you will need to play with the rotation numbers inside. A prim, no matter what, will always spin on that little "X" the movement arrows make when you are in edit mode. An object will also rotate around the center of it's root prim. So with a two prim door - you make a very narrow prim (usually a cylinder but only because it is easier to visualize what is going to happen if you do it this way) and then link your "door" to it - or whatever else you want to have rotate. The first method listed here is basically what Jesse said. I used to use the second method, with what I called a "hinge prim," which is the narrow prim mentioned here. The main problem with this method is that you can't then link your door and hinge to the door frame, or the linkset containing the door frame, because then your hinge prim is no longer the root, or if it is, the whole linkset will turn. ![]() I much prefer cutting the door prim, and putting the door script in it. Not only does this cut prim usage in half for doors, but it also allows you to link your doors to the rest of the structure. But, either will work, and if you don't plan on moving or selling your build, the second method is certainly the easiest. It completely eliminates messing around with editing scripts. cutting prims, offsetting textures, and so on. |
|
Paul Wardark
Wait, what?
Join date: 10 Jan 2009
Posts: 383
|
06-11-2009 00:03
Alright, thanks everybody
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-11-2009 00:54
alternatively orbiting around unlinked points can be found here
https://wiki.secondlife.com/wiki/User:Void_Singer/Rotations and can be modified to have child prims orbit around root prims (ignore the getPos calls, and just use the offset, or ignore the offset and replace it with llGetLocalPos) ETA: this is the simplest door script described by the cut root prim (or cut single child prim), slightly tweaked from my LSL Portal on the llGetLocalRot page (I'd have linked but it's not responding) CODE
_____________________
|
| . "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... | - |