Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Area of a triangle

Slawkenbergius Slade
Registered User
Join date: 21 May 2007
Posts: 133
08-02-2007 15:29
As usual my build outstrips my ability - both with SL tools and basic Maths.

I built a house based on an equilateral triangle; ie 3 x 20m walls, triangular floor plan. Soon discovered this is an inefficient use of space and made it bigger. I now want to double the size to 40m walls giving me a floor area of 692.82msq. The original floor, composed of equilateral triangles, cost me 9 prims per floor (and some complex texture matching).

I thought maybe I could fill the larger space with rectangles and finish off with a couple of triangles but I'm ending up with too many complex triangle shapes to work with. To fill the floor just with linked equilateral triangles is going to cost me 36 per storey (currently planned for 3, ie 108 prims for floor/ceilings alone!!) which is doable but likely to cause shortages later on. I feel it's a bit like a tangram and I should be able to come up with a better solution but have failed miserably. Any ideas?

Oh and I hate texture distorting overlaps :)
KC Despres
Werebutterfly
Join date: 7 Apr 2007
Posts: 166
08-02-2007 16:46
I don't know the answer to your question, but I tried to work with triangles and had a TERRIBLE time lining them up. The seams were always visible. Are you having this issue?

I think I figured out a way to attach new triangles by rotating the base prim 30 or 60 degrees, not the new triangles to be attached. That way the new triangles can always be lined up on an x or y axis and not have to be dragged at a funny angle. (Does that make sense?) I haven't tried this yet, though, and I probably just reinvented the wheel everyone else has been using for years!
-- KC
Lindal Kidd
Dances With Noobs
Join date: 26 Jun 2007
Posts: 8,371
08-02-2007 17:13
An equilateral triangle, 40m on a side, composed of equilateral triangles 10m on a side, will cost you 16 prims per floor, not 36
Larrie Lane
Registered User
Join date: 9 Feb 2007
Posts: 667
08-02-2007 17:22
Need help, IM in world I'll show you what you can do with it... I may be able to reduce your prims considerably if you can give me a little more info....and no problem with the texturing either.. subject to what textures you have of course..

And using triangles, they have got to be the worlds worst nightmare to texture, I very rarely ever to use them, not for their aligning but for texturing purposes.

But I still have triangular windows and 4 sided roofs and stuff with bay windows and no ceiling so you can see right upto to the roofs and beams and stuff.. very rare I think in SL
Slawkenbergius Slade
Registered User
Join date: 21 May 2007
Posts: 133
08-02-2007 18:47
From: Lindal Kidd
An equilateral triangle, 40m on a side, composed of equilateral triangles 10m on a side, will cost you 16 prims per floor, not 36


OMG I'm an idiot! (No news there then)

I used the floor of the smaller version as a template and copied the whole thing linked to fill. I had remembered that I built it from full sized prims but not that I'd had to build the floor for that out of the requisite number of prims, link them and then size the whole thing down to fit, thereby proprtionately reducing the size of the prims. Apologies for wasting your time :redface.

From: KC Despres
I don't know the answer to your question, but I tried to work with triangles and had a TERRIBLE time lining them up. The seams were always visible. Are you having this issue?

I think I figured out a way to attach new triangles by rotating the base prim 30 or 60 degrees, not the new triangles to be attached. That way the new triangles can always be lined up on an x or y axis and not have to be dragged at a funny angle. (Does that make sense?) I haven't tried this yet, though, and I probably just reinvented the wheel everyone else has been using for years!
-- KC


If I understand right this is because an equilateral is formed from a flattened pyramid prim. Obviously this is smaller along the z axis at the top point than across the base. Because I'm making a flat floor I can flatten it to 0.01 on the x or y axes and the difference is pretty minimal (less than 0.001 orientation on the z axis although I suspect repeated copies tends to move them further out of line). As it happens I'm also using a fairly busy texture which also helps disguise it; I'd noticed the mismatched join is more obvious on the untextured prims and it would probably be even worse with plain blocks of colour.

I'm not sure there's an answer to this. If you think of the resulting triangle as points ABC, orienting them to make sure that AB/AC are always matched and CD only ever matches with CD would solve the problem. Unfortunately, building a solid plane requires them to be rotated through 180 degrees in relation to their neighbours. This means that AB will be matched against BA or CA etc. - the widest part of the flattened axis against the narrowest.

If this is just gibberish (and it may well be) let me know & I'll endeavour to keep my ideas to myself in future.
KC Despres
Werebutterfly
Join date: 7 Apr 2007
Posts: 166
08-02-2007 20:58
Actually I think I used a trianglular prism prim squashed almost flat as you describe, but as a template, not as an actual floor prim. I then took a cube, turned it on its side, made it thin to make a floor, and then tapered one side all the way to 1 or -1 to make a triangle. This isn't equilateral, though - so I placed it over the prism template and manually stretched/shrunk the longer point vertex until it matched the prism shape. This gave nice flat edges to butt together, but since it was manually done, I'm sure it wasn't very precise.

Still it was very close and almost succeeded. A thin white line sometimes appeared and disappeared where the edges butt together, but I think I've learned (in another thread) how to get rid of these lines by texturing the edges the same color as the floor carpet texture. I will try again sometime in the near future.

We may be talking about two radically different things, and they are very hard to describe without diagrams. Wish I could see what you're working on. :-)
--KC
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
08-03-2007 06:32
Here's how I'd do it:



14 prims. The scale of the image is roughly 10px=1M. The two large cubes toward the center are 10x10. The right triangles around the edges are cut cubes. The triangle at the peak is a tapered cube. Should take about 10 minutes to build.

If you want, you can lay the image out across a 4x4 grid of 10M cubes in-world to make yourself a template, and then just build right on top of it.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Slawkenbergius Slade
Registered User
Join date: 21 May 2007
Posts: 133
08-03-2007 09:33
From: Chosen Few
Here's how I'd do it:



14 prims. The scale of the image is roughly 10px=1M. The two large cubes toward the center are 10x10. The right triangles around the edges are cut cubes. The triangle at the peak is a tapered cube. Should take about 10 minutes to build.

If you want, you can lay the image out across a 4x4 grid of 10M cubes in-world to make yourself a template, and then just build right on top of it.



Thats what I was looking for!

I almost got there but where you have the two narrow rectangles at the side I'd started from triangles & ended up with odd bits of space as they didn't cut nicely in line with the external wall. Having said that 16 prims isn't such an issue, but now you've sorted it it's definitely the way to go.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
08-03-2007 15:13
I just realized I made a mistake in prim efficiency. The two narrow rectangles in the second row don't need to be there. A single tapered cube can take the place of each of those rectangles along with its neighboring triangle, lowering the total prim count to just 12.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Slawkenbergius Slade
Registered User
Join date: 21 May 2007
Posts: 133
08-04-2007 13:22


This leaves me with the shaded triangle? I don't know if I'm good enough to arrive at that shape with enough precision to fit (if at all). I'm also concerned about matching its texture but I'll give it a go.

If not the 14 prim floor works for me thanks.
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
08-04-2007 15:04
I don't think that's what Chosen meant.

Instead, combine the right triangle with the skinny rectangle to it's left (or right), making it using a cube tapered on one side only. If memory serves, you won't have texture alignment probs the way you would with a skewed cube.

Note that you may also have to make the center square narrower, since the base of the new prim needs to be bisected by the vertical that used to separate the narrow rectangle from the triangle -- IIRC, you can't taper past the center.

Another way to reduce, but only by one prim, is to replace the rectangle-square-rectangle sequence in the middle row with a pair of rectangles. But Chosen's way is better if you can get it to work, since it reduces by two.
Slawkenbergius Slade
Registered User
Join date: 21 May 2007
Posts: 133
08-04-2007 17:16
Thanks Learjeff & Chosen - I get what shape you were describing now.

Don't bother to reply 'cause a couple of prims here or there really isn't worth more of your effort; but I couldn't figure how to produce it. Well, I did actually manage to produce it but only by giving it Taper X 0.5, Top Shear X -0.25 and flattening on the Y axis. Unfortunately this obviously distorts the texture (not an unpleasing effect actually, but impossible to match).

I'll keep playing & figure it eventually - it's the best way to learn :-P
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
08-04-2007 19:49
To eliminate the texture distortion, use planar mapping. That's what it's for.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Slawkenbergius Slade
Registered User
Join date: 21 May 2007
Posts: 133
08-05-2007 07:50
From: Chosen Few
To eliminate the texture distortion, use planar mapping. That's what it's for.



Job done! Thanks for your patience.

I've played with planar but with no idea what it's for. Now I've looked up your old thread on the subject it seems to me it'd be a good candidate for a sticky.