Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
|
01-23-2006 03:14
I know I should be albe to figure this out but I have looked at several door script and do not see what is being done to make them rotate on edge rather than center. I know that I can put the script in the hinge, but that does not appear to be what I see in other scripts.
Thank you, Mod
|
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
|
01-23-2006 03:41
The secret is in the building, not the script.
Create a sphere with end-dimple of 0.5, and then change it into a box. The result is a box that has had half of it "cut off" visually (dimpled away actually), but still rotates around its physical center - which is now an edge.
|
Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
|
Thanks Ben
01-23-2006 03:47
Thanks Ben, This has been driving me crazy. I will try what you suggest. Just for grins, is there a calculation that would would cause a prim to rotate off center that does not involve reshapping it?
Mod
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
01-23-2006 04:26
You could use llSetPos at the same time as llSetRot (or however you are rotating the thing) to shift the door so that it's in the right position when open. I've used this on opening and closing objects. Not as adaptable though.
|
Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
|
Thanks again
01-23-2006 09:59
I will play with that idea too. I just figured with some of the complex calculations I have seen someone would have come up with a formulat for an off center rotation.
Mod
|
Bertha Horton
Fat w/ Ice Cream
Join date: 19 Sep 2005
Posts: 835
|
01-23-2006 22:58
I think the cut for the door so it looks right is 0.375 and 0.875.
_____________________
Trapped in a world she never made!
|
Jigsaw Partridge
A man of parts
Join date: 3 Apr 2005
Posts: 69
|
01-23-2006 23:02
There is a technique for this (see 'rotation about arbitrary point' in the LSL Wiki under 'rotation'). You calculate the target 'position' and 'rotation' of the door and then set them both in one call to llSetPrimitive Params(). I suspect the reason that this method is not used very much is that the visual effect of it is a rather disconcerting 'slide and rotate', like a double hinged door. A simple rotate, however, gives a nice smooth effect.
|
Ploy Vogel
Registered User
Join date: 27 Aug 2004
Posts: 133
|
01-26-2006 10:05
What I do is make a two prim door. I make a very thin prim which would be the height and thickness of the door and put the door open script into it. Then I make another prim of the actual door and put the thin part right next to the door to make it look as though it is one piece. I then link the two together making the part with the script the parent prim, i.e. select it last.
With this method you can have any thickness of door you want.
|