|
Jolan Nolan
wannabe
Join date: 12 Feb 2006
Posts: 243
|
05-09-2006 17:44
I have a planet I want to rotate around its axis, but it will be tilted slightly. What script will spin it properly no matter what angle it's at?
- Jolan
|
|
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
|
05-09-2006 18:03
I think the easiest way to do this would be, take your planet, tilt it slightly, and then put a smaller prim hidden inside it. Link the two, selecting the smaller prim last, as the root prim, then drop your rotation script into the object...
|
|
Jolan Nolan
wannabe
Join date: 12 Feb 2006
Posts: 243
|
05-10-2006 08:09
How would it know which way is down for the planet?
- Jolan
|
|
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
|
05-10-2006 10:45
This will spin an object around its local z-axis (or whatever axis you choose), regardless of the object's rotation. The owner simply needs to touch it to get it started. If the object's in-world rotation changes, the owner simply touches it again, and it should update the llTargetOmega spin to match its new orientation. Untested since the grid is down, but it ought to work.  vector spinaxis = < 0, 0, 1 > ; float spinrate = 1.0 ; float gain = 1.0 ;
default { touch_start( integer num ) { if( llDetectedKey( 0 ) == llGetOwner() ) { llTargetOmega( spinaxis * llGetRot(), spinrate, gain ) ; } } }
_____________________
- Making everyone's day just a little more surreal -
Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
|
|
Jolan Nolan
wannabe
Join date: 12 Feb 2006
Posts: 243
|
05-10-2006 17:47
YAY! Thanks a bunch! I wonder why the Helper said I'd need to know Quatrions or something...? Stop by where ever I live (Obscuro, maybe it's in my profile) and get a spinning Halo Ring World!  - Jolan
|
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
05-10-2006 19:27
Quaternions, heh, we don't like to talk about those around here. Luckily for us, serious rotation manipulations are usually avoidable.
|
|
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
|
05-10-2006 23:56
Most welcome, Jolan.  And yeah, never, ever, ever manipulate quaternions directly. I just leave them all nicely abstracted as 'rotations' with pretty, un-threatening names, and kinda tip-toe around them. 
_____________________
- Making everyone's day just a little more surreal -
Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
|