How to Build a Door

Building using prims, sculpties and meshes. Texture creation techniques.
User avatar
Mike Lorrey
Posts: 268
Joined: Sun Sep 04, 2016 5:40 pm
Has thanked: 61 times
Been thanked: 196 times

Re: How to Build a Door

Post by Mike Lorrey »

Now we need to create our materials. The counterbalance face we want to make transparent, so it will be a separate material from the rest of the door. In the right side of Blender is the "Properties" view panel. Along the left edge of this panel are a bunch of icons. Click the red beach ball icon to get the Materials Properties dialog. Then click the "+" button then the "New" button to create two new materials.
Making a Door Step 7.png
Making a Door Step 7.png (231.53 KiB) Viewed 824 times
8. Here we see new materials. You can double click the default "Material 1", "Material 2" names to give them contextual names to help you keep things organized. Here we are calling the two materials "Door" and "Counterbalance". When we make a mesh, all mesh faces by default are in the first material on the list until we reassign them elsewhere.
Making a Door Step 8.png
Making a Door Step 8.png (207.42 KiB) Viewed 824 times
9. We are going into 'face select' mode and selecting the counterbalance face. Then we go to the Material Properties list and we assign this face to the Counterbalance material by selecting the Counterbalance material on the list and then clicking "assign" button.
Making a Door Step 9.png
Making a Door Step 9.png (190.86 KiB) Viewed 824 times
These users thanked the author Mike Lorrey for the post (total 4):
Ilan TochnerTess JuelMichael TimelessSnoots Dwagon
User avatar
Mike Lorrey
Posts: 268
Joined: Sun Sep 04, 2016 5:40 pm
Has thanked: 61 times
Been thanked: 196 times

Re: How to Build a Door

Post by Mike Lorrey »

Now we are going to apply a door texture to the door mesh. Here is a sample door texture you can use.
Sample Door Texture.png
Sample Door Texture.png (51.51 KiB) Viewed 824 times
On the materials properties list, first 'deselect' the 'counterbalance' material, then select the "door" material from the list, and click the "select" button, and in the mesh edit area you will see it has selected all of the faces assigned to the door material. Now we need to get into the UV map for the door. Now we are going to change our view entirely from the "General" or 'Default" view (your workspace views are in the top menu bar) to the "UV Editing" view. Now we see two panes, our 3d workspace, and a new view that is our UV map or is showing the image editor. The UV Map is how your mesh is mapped so that textures appear on it in the orientation and scale you want them to, so click the button in the upper left corner that is circled here to change the editor type to UV Editor. With the door mesh selected you will see a cross type outline appear in the UV Map area. These are the six faces of the door we made from the cube, the cross shape is the default mapping of a cube in Blender.
Making a Door Step 10.png
Making a Door Step 10.png (221.25 KiB) Viewed 824 times
We are going to remap these faces, so lets first select the two big front and back faces of the door. Once we have done this, we orient our view orthogonally by using our number pad keys, either 1, or shift+1, or 3 or shift+3, so that the hinge edge of the door is to the right of our view. then we go to the UV menu in the 3d view and select "project from view (bounds)" from the UV menu. This will map both the front and back sides of the door in the same way with the hinge edge to the right.
Making a Door Step 11.png
Making a Door Step 11.png (235.11 KiB) Viewed 824 times
These users thanked the author Mike Lorrey for the post (total 2):
Ilan TochnerSnoots Dwagon
User avatar
Mike Lorrey
Posts: 268
Joined: Sun Sep 04, 2016 5:40 pm
Has thanked: 61 times
Been thanked: 196 times

Re: How to Build a Door

Post by Mike Lorrey »

We want to make the edges of the door mesh fit along the right or left edges of the UV Map so they only show the edging, not any door details like windows, trim etc. So we'll select each of those faces and move them to the side, and scale them accordingly.

Now your door is done. You can, if you want, apply the door texture within blender in the material's node properties, but using nodes is another lesson for another time, or you can watch some youtube videos on the topic. Right now, you just need to save this project as a door.blend file somewhere, then go to the file menu and export your file to collada (dae) format. In the export dialog in the upper right is a gear icon. Click that to see the operator presets, and the first dropdown list, select "SL/OS Static Object" from the list to make sure your export is exactly the way that opensim likes to see it.

Once you upload it to opensim with your viewer, make the counterbalance face 100% transparent, then apply the door texture. Now you have a nice visible but simple mesh door that rotates easily on its hinge edge. I'll post a script soon that makes this open and close easily by a proper 90-120 degrees and closes back in the same direction it came from, and plays a creaking and opening and closing sound.
These users thanked the author Mike Lorrey for the post:
Ilan Tochner
User avatar
Tess Juel
Posts: 110
Joined: Sun Sep 11, 2016 4:24 pm
Has thanked: 101 times
Been thanked: 176 times

Re: How to Build a Door

Post by Tess Juel »

Great tutorial! Just one comment:
Mike Lorrey wrote:
Tue Oct 19, 2021 4:57 pm
...
this "counterbalance" face we've created needs to not get in the way of people in the room, so we select its bottom edge in 'edge select' mode than move the edge vertically by selecting "G" and then "Z".
There are three alternative ways to do this:
  • Use a single counterbalance triangle instead of a quad. Yes, it's just one tri saved so it's not a big deal but every little bit helps ;). You can make the counterbalance face as small as you like.
  • Use a loose vertice for the counterbalance. That way you don't need a separate face for it. But make sure the vertices are sorted with the loose one as no. 1 on the list before you export the dae file. If you don't, it will be removed by the uploader.
  • Use a collapsed triangle as the counterbalance, that is a triangle with all three vertices in exactly the same position. This means you won't need a separate face for it since it's invisible anyway.
These users thanked the author Tess Juel for the post (total 2):
Ilan TochnerMichael Timeless
User avatar
Brayla Sana
Posts: 72
Joined: Wed Mar 27, 2013 7:09 pm
Has thanked: 17 times
Been thanked: 125 times

Re: How to Build a Door

Post by Brayla Sana »

You can also have the door become phantom when it opens. Note this only works when the door is a child prim.

in your "door open" section of your script add this:

Code: Select all

    llSetPrimitiveParams([PRIM_PHYSICS_SHAPE_TYPE, 1]); 
Then in the "door close" section, add this:

Code: Select all

    llSetPrimitiveParams([PRIM_PHYSICS_SHAPE_TYPE, 2]); 
Then no part of the door mesh will get in the way of someone walking in.
These users thanked the author Brayla Sana for the post (total 2):
Ilan TochnerMichael Timeless
Dadiella's for Fashion and Brayla Sana Gallery for Building!
User avatar
Cooter Coorara
Posts: 3
Joined: Mon Oct 11, 2021 3:58 pm
Has thanked: 3 times
Been thanked: 11 times

Re: How to Build a Door

Post by Cooter Coorara »

I build all of my own building components, including doors and windows. On Second Life I used Zimberlab's Windoor. It is, without a doubt, the best product I have every purchased in a virtual world. It is menu driven. It rotates, slides, and pivots on edge, middle, or central on the x,y, or z axis. You can control the speed and add custom sounds. A detection mat can be added to open the door automatically without having to click it or walk into it. It's the bomb. Those who haven't found it muddle along with scripts and notecards.

I am not interested in notecards, modifying scripts, or learning LSL. i just want to buy a product like Windoor or Kool Door (a similar product) on Kitely. If I can't find one, I will sit my computer programmer butt down and write one. Everyone here would use it and the scripter will make some dough.

If anyone has one or knows of one, let me know. If anyone wants to write one, I'll be your beta-tester and your first paying customer.

I do have a very simple rotating door hinge script that works, but I am not satisfied. Kitely is a great alternative to SL and can be so much more than it is.
These users thanked the author Cooter Coorara for the post:
Tess Juel
User avatar
Tess Juel
Posts: 110
Joined: Sun Sep 11, 2016 4:24 pm
Has thanked: 101 times
Been thanked: 176 times

Re: How to Build a Door

Post by Tess Juel »

Cooter Coorara wrote:
Sun Oct 31, 2021 1:20 pm
If anyone has one or knows of one, let me know. If anyone wants to write one, I'll be your beta-tester and your first paying customer.
I can port my Menu Door system to opensim if only somebody can help me find some decent public domain door sounds for it. I don't think it's the kind of script you are looking for though. I don't do off center door rotation script because I think it's an unneccessary complication. Make a balanced mesh (or pathcut prim) door as described in earlier posts here and all you need to do is drop the script into it - no setup required whatsoever. I know some builders disagree but well, we just have to agree to disagree.

Nor do I do combined slide and rotation door scripts. I tend to assume the builder knows which action the door needs and have the sense to pick the right one of two fairly simple scripts rather than go through the setup process for a much more complicated one.
These users thanked the author Tess Juel for the post:
Ilan Tochner
User avatar
Snoots Dwagon
Posts: 398
Joined: Mon Jul 30, 2018 9:45 pm
Has thanked: 420 times
Been thanked: 737 times

Re: How to Build a Door

Post by Snoots Dwagon »

Cooter Coorara wrote: I am not interested in notecards, modifying scripts, or learning LSL.

I don't understand Cooter. Where's your sense of masochism? :twisted:
~~~~~~~
Please enjoy visiting DragonForge on Kitely Market. Home of Dwagons.

~~~~~~~
User avatar
Brayla Sana
Posts: 72
Joined: Wed Mar 27, 2013 7:09 pm
Has thanked: 17 times
Been thanked: 125 times

Re: How to Build a Door

Post by Brayla Sana »

Cooter Coorara wrote:
Sun Oct 31, 2021 1:20 pm
I build all of my own building components, including doors and windows. On Second Life I used Zimberlab's Windoor. It is, without a doubt, the best product I have every purchased in a virtual world. It is menu driven. It rotates, slides, and pivots on edge, middle, or central on the x,y, or z axis. You can control the speed and add custom sounds. A detection mat can be added to open the door automatically without having to click it or walk into it. It's the bomb. Those who haven't found it muddle along with scripts and notecards.

I am not interested in notecards, modifying scripts, or learning LSL. i just want to buy a product like Windoor or Kool Door (a similar product) on Kitely. If I can't find one, I will sit my computer programmer butt down and write one. Everyone here would use it and the scripter will make some dough.

If anyone has one or knows of one, let me know. If anyone wants to write one, I'll be your beta-tester and your first paying customer.

I do have a very simple rotating door hinge script that works, but I am not satisfied. Kitely is a great alternative to SL and can be so much more than it is.

There is a script set in the free scripts area of my sim called EZDoor which does much of what you want. Feel free to pick it up any time. It will not work in SL, but it will work in opensim just fine. Also, next to it are the Crystalline door scripts I use in my builds. EZdoor has more options, and the Crystalline scripts are more lean with resources. I have modified the Crystalline scripts to go phantom when the door opens. EZDoor has phantom open as an option. EZDoor has a menu for options that creates the setting notecards, and the Crystalline scripts use a notecard for options - this notecard is well documented so it is not intimidating to use.
These users thanked the author Brayla Sana for the post:
Ilan Tochner
Dadiella's for Fashion and Brayla Sana Gallery for Building!
Post Reply