| Scripting Discuss scripting for SL and other platforms |
| |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) | |
| Senior Member ![]() ![]() | This is driving me crazy. I want an object that is at arbitary X and Z axis to be able to rotate around either axis but still retain the other axis as normal. For example, make a standard box and change it's X to 315.00, so it is at a downwards angle. Select the rotation cursor and put it on world, now rotate it with the blue rotation ring. This is exactly the kind of rotation what I want, to yaw around whilst retaining the same pitch. Same with pitching whilst retaining the same yaw. I never want there to be any roll. The problem is that local rotation which retains the other axis does it too well, if you put it on local rot you can see the blue ring now takes you in a sort of end over end style meaning that globally we are getting roll. If you do it global then it falls over whenever I have changed both the pitch and yaw. I tried taking the original llGetRot and then retaining the axis I wasn't changing but this breaks badly when you are at an angle that needs all three (EG 339.05, 319.20, 59.65). Help ![]() Here's an example which ends up with it going on it's side. Quote:
Last edited by Eata; 08-23-2009 at 07:26 AM. | |
| | |
| | #2 (permalink) |
| Senior Member ![]() ![]() Join Date: Jun 2007
Posts: 331
| I have no idea what you're asking ![]() But, I know a 'Gotcha' I ran into was, well - here try changing this: llSetRot(llGetRot() * quat); to this: llSetRot(quat * llGetRot()); and see what happens. Those two lines will actually produce different results. Whether the different result is what you're looking for, not sure. I remember nearly losing it once I figured out I was having the issue I was because of something stupid like that. |
| | |
| | #3 (permalink) |
| Junior Member ![]() Join Date: Oct 2009
Posts: 1
| How can you expect to achieve the maintenance of a local orientation while spinning on a global axis? It's a bit like asking how can I walk a mile west and end up where I started? You can only do this under particular circumstances, and you give an example of one where you tip on the x-axis and spin on the global z axis. This works because the local x-axis remains at right angles to the global z-axis. After an arbitrary reorientation on the x-z plane it won't work. |
| | |
| | #4 (permalink) |
| Junior Member ![]() Join Date: Jul 2009
Posts: 9
| This is a "right multiplication" and will rotate the object in global coordinates. It is like changing the rotation when you have "world coordinates" chosen in the edit window. This is a "left multiplication" and will rotate the object in local coordinates. It is like changing the rotation when you have "local coordinates" chosen in the edit window. |
| | |
| 1 User Said Thanks: |
![]() |
| Thread Tools | |
| Display Modes | |
| |