**Creating an Octagon Roof in Second Life**

There are scripted tools available in Second Life to position prims, but this tutorial is intended to allow you to build the octagon using only the construction methods available from Linden Labs in their standard SL viewer.

I start by planning the size of the roof based on the size of the building.

This tutorial describes only one case of the octagon roof where I will use only eight prims for the roof. This tutorial will focus on the basics that allow you to make a roof from 8 prims that could make any size up to a maximum of 17.32 meters across from side to side. If you need an octagon roof that is larger, then you will need to use more prims than the 8 shown in this tutorial. In another follow-up tutorial, I will show a more general case where the size can be made larger than I can make from 8 prims. you will need 24 prims or even more to make roofs of larger sizes, but the method requires a few additional steps, and the prim shapes are not all the same for the larger roofs.

The roof configuration I chose for this tutorial was made due to its general good appearance regarding the slope of the roof. It is based on the roof slope of 30 degrees up from the horizon. This is not generally the way a carpenter would build a roof in the USA, and I am unfamiliar with how roof rafter layout is done in the rest of the world where metric dimensions are used. Most carpentry that is done with standard rafters by carpenters (and not made using factory-made wooden trusses) would describe a roof in terms of its rise and run. A roof that is a 6/12 pitch would be 6 inches high for every 12 inches measured along the bottom of the roof or the top of the ceiling. (The horizontal plane.)

Let’s start with the octagon that we have already built in our first tutorial about the octagon building. This octagon has a wall length of 4 meters. We need to know the distance from the center of this octagon to the outer surface of the octagon. We could use the trigonometric functions to learn this, but I will show you how to let the Second Life user interface give you this distance.

Set your octagon with its center at a whole number location on the coordinates of you sim. I have chosen 100, and 100. I do this so that the location of the individual prims is easily learned by subtracting 100 from its coordinates on the grid. From its location on the grid, we quickly know the distance from the center of the octagon if it were measured along a straight line on the grid.

Find one face of the octagon that is perpendicular to either the x axis or the y axis. Offset this prim by half its thickness. Now the location of the center will read where the outer surface had been. This dimension is useful in making your choice of the roof size for this building.

Let’s say you choose your roof to overhang the walls by exactly 0.5 meter, then you can simply add 0.5 meter to the value found in the preceding step. Or, again you could offset the wall prim used in the preceding step by one full thickness of the 0.5 meter thick wall. This again allows you to know the distance from the center by reading it directly from the edit window.

The dimension you choose is your choice. You can make this decision of the length for this dimension and the method of construction will remain unaffected.

From your chosen dimension, you will first determine the length of the roof edge of one of the 8 roof segments. The formula used is based on the Trigonometric function for a right triangle with a 22.5 degree angle.

The formula for the roof segment edges L1 is as follows:

L1 = 2 x (Base Length x Tangent (22.5deg))

For a Base Length of 5.5 meters, the Roof edge is 4.556349186 meters

Enter this value with at least 7 digits after the decimal place. While the build window only shows three digits, the SL system records several more digits that are not shown. This extra accuracy will benefit you in how close the prims edges come to each other. ( I continue to discuss with knowledgeable people how many decimal places are really of value for the accuracy we need for this type of construction, and the answer varies from 5 to 7 decimal places.)

Now, from the same base length we can determine the roof segment’s longest dimension L2. We will place the roof at a 30 degree angel from the horizon so, the formula for the long dimension is:

L2 = Base Length / Cosine 30deg. Again, enter this value with 6 or 8 digits after the decimal place.

See the video here:

Video Tutorial of Building an Octagon Roof in Second LifeThere is no narration, so continue to read the explanation that follows.

1) Create and position the first roof segment.

2) The Roof’s Edge length L1 will be the X dimension of the prim.

3) The Roof Segment’s long dimension L2 will be to the Z dimension. The Y dimension is the roof thickness and again, just like the octagon walls, we will make it 0.5 meter thick.

4) Taper this prim along the X axis to the full 1.00 value.

5) Place this prim at the same center as we chose for the octagon walls. In my case it is X=100, Y=100, Z= 2,104.

6) Now rotate this prim along it’s Y axis by 60 degrees. The reason we use 60 degrees for this rotation, is that it is measured from the vertical position as it was built.

7) Now Make a copy by the shift drag method along the Z axis and bring it up to any height above the first prim. Now, rotate it around the Z axis by 45 degrees and then drop it back into place at the same height as the first prim.

8) Repeat this process 6 more times.

9) As you can see, we have been building along the construction lines that define our roof’s top surface and the centerline of each of our roof segments is on that construction line until we shift it ½ the prim thickness down along the normal line that is perpendicular to the roof surface.

10) With all prims at the same height, change to local ruler mode, and shift each of the roof segments down to their 50% location along the local ruler.

I have tested these steps and used them to build a number octagon roofs. If you experience difficulty with these steps, then it is entirely my difficulty in communicating their intent.

Some time soon, I hope to make a video tutorial for these steps which will surely be easier to comprehend when you see it in a visual form.