Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to Link a Moving Door to an Object?

Wildefire Walcott
Heartbreaking
Join date: 8 Nov 2005
Posts: 2,156
08-20-2006 12:36
So, I'm building a medicine cabinet. The door consists of several prims (frame, glass, handle) and I want it to open and close- whattaconcept. But I don't understand how to link my door to the rest of the project so that the whole thing is a single object, but the door can swing independently. I HATE buying things that come in multiple pieces that you must realign every time you feel like rearranging the furniture, so I don't want to end up with something like that.

I've seen cars with opening doors and single-object houses that have them, so it must be possible. BUT HOW?????

EDIT: Ah, looks like I may have found my own answer in this thread. It appears that the fact that my door is multi-prim may yet present some problems, though, although a couple people mention workarounds.
_____________________
Desperation Isle Estates: Great prices, great neighbors, great service!
http://desperationisle.blogspot.com/

New Desperation Isle: The prettiest BDSM Playground and Fetish Mall in SL!
http://desperationisle.com/

Desperation Isle Productions: Skyboxes for lots (and budgets) of all sizes!
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
08-20-2006 15:24
Ultimately, there does not seem to be a really good way for all the prims in the door to move together while linked to the rest of the cabinet. The best workarounds may still result in the pieces sort of moving independently of each other sometimes.

Baron H.
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
08-20-2006 23:10
It's possible, and best with single-prim doors. Meaning, the door is linked to a house or vehicle, but the part that moves - the door - is one prim. With that, you can use the LocalPos and LocalRot functions to have the door open/close while remaing linked.

For rotaring doors, it's even easier if you use the 'cut' params to cut the prim in half so that the door's hinge.. is the center point of the prim. A simple rotation will cause the prim to rotate around its center-point which will give the appearance of a hinged door.
Wildefire Walcott
Heartbreaking
Join date: 8 Nov 2005
Posts: 2,156
08-21-2006 06:33
From: DoteDote Edison
For rotaring doors, it's even easier if you use the 'cut' params to cut the prim in half so that the door's hinge.. is the center point of the prim. A simple rotation will cause the prim to rotate around its center-point which will give the appearance of a hinged door.

Ooh, I wondered how that worked! I've seen single-prim doors that appeared to be twice as big as they were, that appeared to rotate in just such a manner.

Yeah, I tried the TimelessLinkedDoors script yesterday and it didn't work out like I'd hoped. Only a single element of the door moved- even though I put the script in every prim component of the door- and the one prim rotated on its center axis instead of following the Opened and Closed states I specified (i.e. rotating on the 'hinge')

My medicine cabinet has a frosted-glass door with a wooden frame and a ceramic knob. I'm thinking about ditching the knob and going single-prim if I can figure out how to make a multilayer (glass/wood) texture with appropriate alpha channels to keep the glass semi translucent.
_____________________
Desperation Isle Estates: Great prices, great neighbors, great service!
http://desperationisle.blogspot.com/

New Desperation Isle: The prettiest BDSM Playground and Fetish Mall in SL!
http://desperationisle.com/

Desperation Isle Productions: Skyboxes for lots (and budgets) of all sizes!
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
08-21-2006 17:14
From: Wildefire Walcott
My medicine cabinet has a frosted-glass door with a wooden frame and a ceramic knob. I'm thinking about ditching the knob and going single-prim if I can figure out how to make a multilayer (glass/wood) texture with appropriate alpha channels to keep the glass semi translucent.
I think this will be the best option, rather tahn 3-prims/3-scripts in order for the door to function while linked to the rest of the object.

About the alpha.. if you have Photoshop, here's a crash course:

1) paint your glass onto a layer, don't worry about the transparency.
2) click the <new layer> button to create a new layer.
3) paint your wooden frame and ceramic knob onto the new layer.
4) switch from the layers tab to the channels tab.
5) note that you see the red/green/blue channels (to ensure you're in the right place).
6) click the <new channel> button to add a new channel (it'll be named 'alpha').
6a) the alpha channel will be solid black, you want to make it solid white... so,
7) fill the alpha channel with solid white.
8) switch from the channels tab, back to your layers tab.
9) select the frame layer.
10)use the magic wand to select the empty space in the middle of the frame layer.
11)switch from the layers tab, back to your channels tab.
12)choose a shade of gray, 50% gray will be 50% transparent
13)fill the selection with gray
14)save the image as a .tga (targa) file and choose the 32-bit option.
15)import into SL, if you see checkers through the 'glass', you're good to go.

The alpha channel is the key. The solid white parts of the alpha channel will be solid in SL, the solid black parts of the alpha channel will be invisible in SL. 25% dark gray on the alpha channel is equal to a 75% transparency setting in SL... 75% light gray on the alpha channel, translates to a 25% transparency setting in SL.
Wildefire Walcott
Heartbreaking
Join date: 8 Nov 2005
Posts: 2,156
08-22-2006 00:43
Wow, thanks so much, DoteDote! I'm gunna do just that!
_____________________
Desperation Isle Estates: Great prices, great neighbors, great service!
http://desperationisle.blogspot.com/

New Desperation Isle: The prettiest BDSM Playground and Fetish Mall in SL!
http://desperationisle.com/

Desperation Isle Productions: Skyboxes for lots (and budgets) of all sizes!