Jump to content

Legume

Resident
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Legume

  1. Thanks for the replies Innula and Nova. Innula, I want to take a rotation in Global co-ordinates, translate it so it is in local co-ordinates and then apply it to a prim (the avatar) on the furniture. I have tried "rAvatar * rReported * rObject" but it always turns a small reported rotation into a much larger rotation. I have tried it as "rAvatar * (rReported * rObject)" but that did not help. I am guessing the (rReported * rObject) translates the reported delta rotation to local co-ordinates, similar to how your "grX45*llGetRot()" applied the 45 degress to the local X axis but no matter how I try it, it is never quite right. It either increases the size of the rotation drastically or rotates it along the wrong axis. I have tried using PRIM_ROTATION and it did not work as expected. I am not sure which part is going wrong. I just know why I apply the reported translation directly and the furniture's base rotation is not <0, 0, 0> (it is more like <90, 0, 90>) the avatar rotates around the wrong axis. But when the furniture's base rotation is <0, 0, 0> it works as expected. Nova, I don't think that is going to solve the problems as expected. I can't exactly wrap my head around how it is going to work but the helper object would still be reporting that it rotated 5 degrees around the world's X axis, regardless of how it started out. And it would still need to translate to such a rotation to the avatar's rotation. Perhaps if the helper object had more than one prim it might help but that is getting complicated too. Thanks for the ideas though, legume. *EDIT* I don't think I described what my trouble was in this last edit very well. I will rotate the helper object 5 degrees in the global co-ordinate system (for example). When I apply the rotation to the avatar I want to keep applying based on the global co-ordinate system but it always applies it to the local co-ordinate system. How do I translate the rotation so it will still be the same in the global system when applied to the location co-ordinate system?
  2. Hi Everyone, I am trying to work on some furniture and I am having trouble wrapping my head around rotation math I need for it. I have a "Helper" object that can be rotated and subsequently rotates the avatar on the furniture. It reports how much it has rotated to the main script which then adjusts the avatar the same amount. I have adjusting the position working fine and adjusting the rotation works fine when the main object's rotation is <0, 0, 0>. The trouble comes when the main object is rotated. I am rotating the helper object in the X direction (for example) but the avatar is rotating in the Y direction (also for example, depending on the furniture's root prim is rotated). I know that there is some rotation math that needs to be done to the incoming rotation but I just can't figure out what that math is. Note: I have been working in vectors but if things are explained in more general terms or in rotations I can probably convert between them. To summarize: - I have an incoming rotation vReported which is a delta rotation in Global co-ordinates. - I have the current rotation of the avatar sitting on the furniture vAvatar in Local co-ordinates. - I have the current rotation of the furniute root prim vObject in Global co-ordinates. - The new avatar position = vAvatar + (vReported <Somehow convered to local co-ordinates with vObject>). Can someone help me understand how to do this step? Thanks, legume.
×
×
  • Create New...