Controlling Rotating Objects via script
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
08-16-2004 16:48
I'm also working on another project where I need to rotate something. This object has two moving parts and one that stays stable.
I want to make a script that will permit me to rotate two objects independantly of each other. So this is kind of a scripting question and a building question at the same time.
Question part #1. When you link two things, does it prevent them from moving later? Can you link the three things together, and expect them to be able to move?
Question part #2. What do you need to know about the moving parts to be able to move them? I want the rotation to be at one end of the object similar to a door. I thought about the "Hinge" idea where you put the last linked part of that as the hinge and that can be very small so you will effectively get the rotation from that point.
Thanks for helping me over the "Noob Hump". I've already seen some real good suggestions to another of my questions in here. Thanks in advance for your help!
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Siro Mfume
XD
Join date: 5 Aug 2004
Posts: 747
|
08-17-2004 12:26
There are a number of ways you can accomplish what you want. It all depends basically on how complex you want to get. In the situation where both objects will be rotating around the root or parent prim, the wiki's information on child rotation is quite complete. http://www.badgeometry.com/wiki/ChildRotationIf, in your situation you need to rotate and track the position of an object that is one or more links away from the root prim, I would also suggest the wiki's example on ExampleGetRootPos http://www.badgeometry.com/wiki/ExampleGetRootPosFurthermore, if the second situation is correct, while you're at the wiki look up how to use Linked Messages to efficiently communicate between the script inside your root prim and the script inside each linked prim that moves (as you'll need a script for each one that moves if you have moving/rotating prims more than one link away from the root). I hope this helps somewhat.
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
08-18-2004 07:45
I'm trying to control two objects which rotate. I also want these two objects to be a part of the main prim. I want them to all be present when the object is brought out of the inventory, or out of the delivery box (thinking about sales for this already =)
I think this is over my head at the moment, so I will wait till I have more experience and start getting into this again later.
Thanks for the help!
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Siro Mfume
XD
Join date: 5 Aug 2004
Posts: 747
|
08-18-2004 14:42
ah well what I mean is rotation is fairly easy when you have something like this(like wings or stubby legs or arms or something):
|-linked prim---|--root prim--|---linked prim-|
That's pretty easy because all you're doing is setting up rotation in relation to the root prim.
now if you have something like this (like an arm or leg or other limb or something):
|-linked prim--|-linked prim--|-root prim--|
Then it gets more complicated because the prim on the far left will also be rotating in relation to the root prim, which can cause it to look like it detaches from the middle prim. That's where llSetPos comes in. You basically need to control much of the action that goes on in this situation because the prim on the end will have to line up with the prim in the middle to look realistic and such.
oh and you can also have this situtation:
|-linked prim-|-root prim-|-linked prim-|
or
|-linked prim-|-linked prim-|-root prim-|
In this situation, all you want to do is make one or two prims rotate around themselves, like a lawnmower's blade, a car's wheels, VTOL fanblades, planets, and whatever. This is when you still want a seperate script for rotation, but most of the time it's not necessary to control it as it's just doing something simple and continuously.
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
08-22-2004 08:49
My situation is more like:
root prim -- | -- first linked prim
root prim -- | -- Another linked prim
Where the rotation of each of the child prims do not interact with each other, they just want to remain rotating based on the base prim.
I did go to the Wiki site, and now I need a site to help me read the Wiki site. =)
It's all starting to get out of focus to me, and the strange thing is, outside of LSL I have no problem writing communication scripts in PERL and TCL/TK, but this LSL stuff reminds me of the "Farside" cartoon where there are massive formulas written on a chalkboard and at the bottom there is a small message that says:
"...and then a miracle happens"
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Wraith Jensen
I can walk thru walls....
Join date: 8 Aug 2004
Posts: 130
|
08-23-2004 17:18
LOL
I agree that LSL needs better IPC. It seems odd to have to use chat to send messages around, when we should be able to simply trigger events in other scripts like one does with COM in Windows.
|
Siro Mfume
XD
Join date: 5 Aug 2004
Posts: 747
|
08-23-2004 22:28
From: someone Originally posted by Samhain Broom My situation is more like:
root prim -- | -- first linked prim
root prim -- | -- Another linked prim
Where the rotation of each of the child prims do not interact with each other, they just want to remain rotating based on the base prim.
I did go to the Wiki site, and now I need a site to help me read the Wiki site. =)
It's all starting to get out of focus to me, and the strange thing is, outside of LSL I have no problem writing communication scripts in PERL and TCL/TK, but this LSL stuff reminds me of the "Farside" cartoon where there are massive formulas written on a chalkboard and at the bottom there is a small message that says:
"...and then a miracle happens" okay this sounds exactly like what I described in the first instance, two prims directly off the root prim that need to rotate in relation to the root prim. That's pretty easy. Check out this link: http://www.badgeometry.com/wiki/ChildRotationread through the math bit if you can handle it, or just skip down to the bottom where it gives you step by step instructions on how to make it work 
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
08-26-2004 11:30
I give up. This is a continuously spiraling conversation. Now I need an explaination of the explaination of the explaination. So... nevermind. =)
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Jake Cellardoor
CHM builder
Join date: 27 Mar 2003
Posts: 528
|
08-26-2004 12:21
Samhain, send me an IM in-world, and maybe we can schedule a time to work on your rotation project.
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
08-27-2004 13:13
Thanks Jake, I will do that, I would have last night, but there were too many other things going on.
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|