Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Is this type of Rotation possible?

duLuna Bosatsu
OMnomnom nom.
Join date: 4 Nov 2007
Posts: 102
10-31-2009 03:17
Clicky for example

There's multiple prims in what should spin around it (little fiery flying guy), so to create a little movement, I thought him hovering up and down a bit would be cute. Is there a way to spin him/all the child prims around on an axis like that?


thanks much <3
Rime Wirsing
Color me gone
Join date: 31 Dec 2008
Posts: 345
10-31-2009 08:23
Start with this maybe?

Create and link two prims with the root prim being the center of rotation.

Add this to the root prim...

CODE

default
{
state_entry()
{
llTargetOmega(<0,1,0>,0.3,1.0);
}

}


...and this...

CODE

default
{
state_entry()
{
llTargetOmega(<0,1,0>,-0.3,1.0);
}

}


... to the child prim.

Both prims rotate about the same axis <0,1,0> but have spins in opposite directions 0.3 and -0.3 The script in the child makes it rotate about its own axis while the script in the root makes the whole linkset spin about the axis of the root....

Caveats: Looks like timing can drift and if the child you want to rotate is itself is made up of multiple parts...

Still a fun exercise before more knowledgeable replies :)

Rime
duLuna Bosatsu
OMnomnom nom.
Join date: 4 Nov 2007
Posts: 102
10-31-2009 09:07
hmm, yeah, I'll try it... XD but I guess that means every child prim is going to have to have that script

(here's what it looks like for better reference, 15prims in all)

there's an animation script in the wings, so I'm not sure how the extra script will effect it @__@ -hopes the whole thing stays together-
Rime Wirsing
Color me gone
Join date: 31 Dec 2008
Posts: 345
10-31-2009 10:58
Yeah, not going to work for a complex object as far as I can tell.

If you can make it rotate then maybe you could create an invisible target prim and use llLookAt() to make it always face that direction? Just guessing here and don't have time to give it a try.

I'm sure someone with a lot more skill will be along shortly :)

Cheers
Rime
duLuna Bosatsu
OMnomnom nom.
Join date: 4 Nov 2007
Posts: 102
10-31-2009 11:02
thanks Rime :D yeah, the animation script is locked to the root prim, so it's wings go flying toward the root prim instead of staying with the child prim group. Maybe I'll find a hinge script instead of the animation one to give the latter idea a better possibility :D good to know something in the scripting world exists like that!

-camps in thread patiently-