Moving parts on linked objects
|
|
Jeremy Bender
anachronistic iconoclast
Join date: 12 Aug 2006
Posts: 99
|
09-01-2006 10:47
Hello, newbie question I guess but I cannot find the answer to it.
I want to move a prim on a linked set. Basically its an elevator fin on a vehicle.
I know how to make a hinge by putting a rotation script into a prim that acts as a rotation point and link that hinge prim to the door or fin, but then the door cannot be linked to the house or the fin to the vehicle.
I know I have seen vehicles that reconfigure themselves in place, have fins that turn etc. so there must be a general principle by which its done, but I cannot find it. Every time I ask someone in a sandbox they politely go through the explanation of making a hinge prim but that can't be all there is.
I have also read about the actual "physics-hinge" and how lame, incredibly hard to use, and soon to be obsolete they are and I am hoping that that aint it either.
Please respond in English if you feel inclined to respond at all. I am quite quick on the uptake but don't speak "scriptease."
Thanks
|
|
Elexia Yan
Registered User
Join date: 21 Aug 2006
Posts: 18
|
09-01-2006 11:11
im new aswell and was wondering the same things, whether its possible to rotate 1 prim so that the attached ones rotate with it.
I did find some free vehicles with moving parts , but they are just cut prims that use localrotation to change their appearance
|
|
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
|
09-01-2006 11:25
1st post
Local rotation is the answer you are looking for I believe. Everytime you issue a llSetLocalRot on a prim that is not the main one in a linked set only that one will move.
2nd post
Rotation in general is the answer you are looking for i believe - if you issue a llSetRot ( preferable from the main prim i find - easier to see wheres it is being issued ) then the whole construction ( ie all linked parts will rotate )
If you are looking to rotate a bunch of things within a linked set - then I am afraid you will have to hit the wiki and do the math ( there is no concept of main prim-group prims-individual prims - you get the choice of moving the main prim or one of the sub prims - not a group of them )
Look in the Wiki under rotation and ( to 1st poster ) llSetLocalRot
|
|
Jeremy Bender
anachronistic iconoclast
Join date: 12 Aug 2006
Posts: 99
|
09-01-2006 12:48
From: Adriana Caligari 1st post
Local rotation is the answer you are looking for I believe. Everytime you issue a llSetLocalRot on a prim that is not the main one in a linked set only that one will move.
....
Look in the Wiki under rotation and ( to 1st poster ) llSetLocalRot Thanks Adriana.  The related question that comes to mind is assuming its an elevator or aileron that I am moving, ... how can I get it to rotate on its edge? If I am understanding correctly, my choice is rotating the whole link set or rotating a single prim in the set but not groups or subsets because LL doesn't recognise subsets. Therefore to rotate something on its edge by using a "hinge prim" is out because that goes back to the problem of rotating a linked subset. Am I to assume then, that to edge rotate something, one must use code to set the location of the part moved (in combination with llSetLocalRot) and that you have to go through the pages of math or whatever to figure it all out? If so, please at least tell me that the locations and rotations are relative to the parent prim or I shall have to kill myself. 
|
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
09-01-2006 13:01
From: Jeremy Bender The related question that comes to mind is assuming its an elevator or aileron that I am moving, ... how can I get it to rotate on its edge? You can't ^^; each prim can only rotate around it's centre. You can try to create illusion of rotation on edge either by rotating and translating the prim at the same time, so the final location makes it appear like it rotated on hinge ... or alternatively by playing with cut-begin and cut-end parameters of your prim and such you can carve out half of it, which will make it appear like it rotates on off-center axis. From: someone If so, please at least tell me that the locations and rotations are relative to the parent prim or I shall have to kill myself.  I think they are (parent being the root prim here) ... but it's little help really, rotations and translations in SL can be tricky and suicide inducing enough as it is ^^;;
|
|
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
|
09-01-2006 13:15
If i remember correctly a linked prim's local position is based on its center relative the center of the main prim.
So <0,0,1> as a local pos is 1 meter higher ( +z ) than the root.
Local rotation I believe is always relative the the prim's center - not the main prim's.
Johanna's idea of cut start/end to "half" the prim and then rotate is the best way, as it looks like it is rotating about a hinge.
If you can find an easy way to do it like that - do it - DON'T go into the math unless you absolutely have to or love math ( I like math - but rotations give me a headache everytime )
|
|
Jeremy Bender
anachronistic iconoclast
Join date: 12 Aug 2006
Posts: 99
|
09-01-2006 14:44
From: Adriana Caligari If i remember correctly a linked prim's local position is based on its center relative the center of the main prim.
So <0,0,1> as a local pos is 1 meter higher ( +z ) than the root.
Local rotation I believe is always relative the the prim's center - not the main prim's.
Johanna's idea of cut start/end to "half" the prim and then rotate is the best way, as it looks like it is rotating about a hinge.
If you can find an easy way to do it like that - do it - DON'T go into the math unless you absolutely have to or love math ( I like math - but rotations give me a headache everytime ) Thanks again. I know this stuff it probably in the Wiki but it's a real help to talk this stuff out. The Wiki just makes my eyes glaze over sometimes. 
|
|
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
|
09-02-2006 15:06
Simple way to make a single prim door rotate on it's 'edge' (might beable to use this for your elevator fin).
Rez a default cube, and goto the Object tab in the prim editor. Set Path Cut Begin to 0.375, and Path Cut End to 0.875. Half the prim will be cut off, which you can then resize the prim and use a simple llSetRot(), or llSetLocalRot() for attached, to rotate it around it's apparent edge.
If you need to use a sphere, use the Dimple to remove half the prim. Cylinder can use Path Cut Begin at 0.5.
If you can't remove half the prim for your fin, then you'll have to use llSetPrimitiveParams() to set the position and rotation at the same time, which would give the same effect.
|