Rotation problems
|
|
Dire Graves
Registered User
Join date: 3 Sep 2007
Posts: 51
|
10-03-2007 21:26
I'm a little confused about how the rotation works... On most objects you can make them rotate while staying parallel to the ground by changing the Z axis rotation, but on others, rotating Z causes them to do all kinds of crazy things. I'm not sure but this seems to be related to the type of prim that is used for the root prim. Can somebody please clarify this for me? Thanks 
|
|
Dire Graves
Registered User
Join date: 3 Sep 2007
Posts: 51
|
10-04-2007 20:23
Hmm.. i thought for sure this was going to be a super simple question. Maybe I'm not making my question clear? Maybe I should have asked it in the Scripting Tips forum where all the smart people hang out?  j/k Just in case I wasn't clear which I probably wasn't... all I'm asking is why do some objects rotate differently? I have two chairs that I built. If I rotate the first on it's Z axis it just spins (which is the behavior I like). If I rotate the other it kinda spins and flips as if I was rotating it on Z and Y. I don't want it to rotate like this because my script does not position the chair as expected. I really just want to understand what's going on here so that I can prevent it from happening. It's a very simple chair and if anyone would like me to send them a copy so they can see what I'm talking about, i would be happy to do so. Thanks in advance for any helpful tips you can offer a noob  .
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
10-05-2007 03:28
well z-axis rotation for script is LOCAL....
so if you build your chair, and at some point rotate the root prim , you've changed where the z-axis lies....
the other posibility is that the root prims z axis is not aligned with the overall object, which can cause wobble, when rotating....
I also see to remember some weirdness with spheres... the local z-axis isn't top to bottom, but east to west (or maybe that's just the conversion it does when changing types to box... I forget)
anyway, hope that helps, if not post back and me (or someone) will take another crack at it
|
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
10-05-2007 06:46
As Void said, a rotating a linkset is usually based on the local axis orientation of the root prim. For that reason it is a good idea to make the root prim of a rotating linkset a simple cube that is on the default axis orientation, and embed that in the linkset that you plan to rotate. Or if you use, for example, the seat prim of the chair as your root prim, make sure the seat prim is not rotated to an odd direction.
This is similar in principle to what better-quality prim attachment makers do, where they use a small cube as the root prim for their attachment. It gives you a predictable orientation axis, as opposed to basing the rotation on a twisted torus hair curl that is at some odd angle.
As for spheres, by default they rez pre-rotated by 90 degrees. So they start out on a different local axis than the world axis or a prim like a cube.
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
|
|
Dire Graves
Registered User
Join date: 3 Sep 2007
Posts: 51
|
10-05-2007 07:03
Yup that was it, I had rotated the seat cushion 90 degrees on Y and it was the root prim. Kinda strange that when it was rotated like this it would not allow me to rotate X (on the link set), when I'd try it would just revert the X rotation value back to zero and move the value into the Z rotation. It also seems that in order for my script to get the key of the seated av the script must be in the prim with the sit target even if the the prims are linked which means that if I just wanted to drop my script into the chair the prim with the sit target would have to be the root prim. Is this correct? Thanks for your help void! 
|
|
Dire Graves
Registered User
Join date: 3 Sep 2007
Posts: 51
|
10-05-2007 07:14
From: Ceera Murakami As Void said, a rotating a linkset is usually based on the local axis orientation of the root prim. For that reason it is a good idea to make the root prim of a rotating linkset a simple cube that is on the default axis orientation, and embed that in the linkset that you plan to rotate. Or if you use, for example, the seat prim of the chair as your root prim, make sure the seat prim is not rotated to an odd direction. This is similar in principle to what better-quality prim attachment makers do, where they use a small cube as the root prim for their attachment. It gives you a predictable orientation axis, as opposed to basing the rotation on a twisted torus hair curl that is at some odd angle. As for spheres, by default they rez pre-rotated by 90 degrees. So they start out on a different local axis than the world axis or a prim like a cube. Good info thanks! I was using a twisted torus as the cushion which looked better, but I ended up changing it to a sphere and zeroing out it's rotation. Kinda sucks that I couldn't use the prim I wanted but as I said I was having problems with the sit target. The script had to be in the root prim otherwise when it tried to reposition the chair it would only re-position the prim the script was in. The script also had to be in the prim with the sit target in order to get the sitting avs key which pretty much meant the cushion had to be the root prim and limited my choices for prim type if I wanted to have the chair rotate the way I wanted. I definitely have a better understanding of the issue I was having, thanks guys.
|
|
Dire Graves
Registered User
Join date: 3 Sep 2007
Posts: 51
|
10-05-2007 07:18
Int vSelf = Sing(void); Does this mean you don't take requests? 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
10-05-2007 09:18
no, just that I can't actually sing =)
not sure about the sit target key problem, doesn't seem right...
there's a hack that allows you to move a seated avatar as if it were a child prim, but it's not for sure if it will be returned to use (currently broken)
i mention it because there was talk of retrieving keys and positions of av's this way (through llGetLinkPrimitiveParams I think) and that part may still work, and give you what you need.... it may be that sit target only returns the key for an av to that prim (but that seems weird and wrong)
not my forte' sry
|
|
Dire Graves
Registered User
Join date: 3 Sep 2007
Posts: 51
|
10-05-2007 14:11
Yeah, I was reading about that hack. It sounds like it should be back up and going soon if it's not already. It sounds like a nice feature to be able to re-position an ave without using a pose ball. I'll look in to getting the av key with llGetLinkPrimitiveParams() that seems like it would work...good idea, thanks.
|
|
Katryna Jie
Registered User
Join date: 24 Jun 2007
Posts: 187
|
10-07-2007 02:58
Lol.. I had the exact sameproblem today... went to rotate something and it flew off into the distance... turns out I had selected another of my prims further away without realising it ~_~
|