Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Texturing inside a hollow Cube

JulieAnne Rau
Curious Girl
Join date: 21 Jun 2007
Posts: 201
03-11-2008 08:36
So, I built a cube and hollowed it out so that I can use it as 4 walls. I textured the outside of the cube with a simple window and wall. However, the inside of the cube appears as one complete texture. Is there a way to make the inside look like the outside of the cube?

Thanks, JulieAnne
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
03-11-2008 09:07
If all you want is the same texture to appear on all four inner walls, simply increase the repeats per face. If you want the appearance of four different textures on the inside of the cube, you'll need to make one single texture with 4 panels in it.

Since you mentioned your wall texture has a window in it, I assume it's got transparency. Be aware that if you put a 32-bit texture on both the inside and the outside of a cube, you're going to have sorting problems. The inside will appear to show through the outside in places, depending on the current camera angle. See the transparency guide at the top of the forum for information on this.
_____________________
.

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.
JulieAnne Rau
Curious Girl
Join date: 21 Jun 2007
Posts: 201
03-11-2008 09:24
Thank you. My plan is to make the inside of the cube slightly transparent so that the dark protion stays intact but the window itself becomes slightly transparent. When I get home from school I will give it a try. Thanks. JulieAnne
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
03-11-2008 09:30
If the inside and the outside both have transparency, you will have sorting problems. You'll need either to make one texture fully opaque (24-bit), or else to invest some extra prims into the build.
_____________________
.

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.
JulieAnne Rau
Curious Girl
Join date: 21 Jun 2007
Posts: 201
03-11-2008 10:22
ok... I'll have to look at that. I'm trying to resist using more prims.

JulieAnne
Larrie Lane
Registered User
Join date: 9 Feb 2007
Posts: 667
03-11-2008 10:39
From: Chosen Few
If you want the appearance of four different textures on the inside of the cube, you'll need to make one single texture with 4 panels in it.


Chosen, designing the texture with 4 panels is obviously right but the repeats and offsets are always dificult if not impossible. It's not so bad if you are using a cut prim with only 3 sides but texturing a full 4 sided hollowed prim is a little more challenging.

I studied this last year and came up with the following which i copied and pasted from another thread where I mentioned the same thing.

To start the design process of a texture for a 4 sided hollowed prim you would need to know the exact distance of the gap inside the hollowed prim. For example a 10x10x10 prim hollowed out to 95, the distance between all sides will be 9.5m so the texture would have to be designed using these measurements. The exact distance is actually 9.4995 but most residents will only get 9.5m so using 9.5m some horizontal repeats and offsets will need to be made as the overall texture size will be 2cm to big.
The distance will change subject to the hollow size and prim size and one texture will only fit one size. So taking an 8x8x8 prim and hollowing it to 95 the distance between the sides would now be 9.6m. (Using repeats and offset with a texture of a different size you will not be able to line up all sides perfectly).

The texture would have to be broken into 4 sections, you will need to do the following in your photo package to get them to appear correctly after uploading.

1 Ceiling
2 Wall (rotated -90 degrees)
3 Floor
4 Wall (rotated 90 degrees.

Using the above order should allow you to texture a hollowed prim with minimal repeats and offsets. This of course will be subject to how precise you have measured the distance between the sides if you also want to align your hollowed prim to other prims with the same texture seamlessly.

With regards to using a 32 bit texture for windows this is best avoided and actually, I would recommend that the OP does not even waist their time trying. Stick to normal prims for this method.
JulieAnne Rau
Curious Girl
Join date: 21 Jun 2007
Posts: 201
03-11-2008 13:01
WOW, that is a very good and detailed explaination. I appreciate you taking the time and responding. I will look into this when I get home. Perhaps I can IM you inworld if I'm stuck. Thanks for your help.

JulieAnne
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
03-11-2008 19:49
somewhere on this forum is a formula for setting the repeats on the inside of a hollow cube,
the problem being that that it's based on hollow %, numbe of repeats needed, and an amount that represents the inside corner to the outside corner times two

if I've reconstructed that right it'd be
(sqrt((1 / hollow - 1)^2 * 2) + 1) * 4 * horizontal_repeats_per_face
with an offset of
sqrt((1 / hollow - 1)^2 * 2) / 2
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
JulieAnne Rau
Curious Girl
Join date: 21 Jun 2007
Posts: 201
03-12-2008 14:58
very kool, I haven't had a chance yet to get back to my project but when you have 1/hollow is hollow the percentage? ie: 95%?

JulieAnne
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
03-12-2008 15:03
It's 0.95, the percentage expressed as a decimal. All Void is doing is getting the hypotenuse of that triangle in the corner (the distance between the corner of the prim and the corner of the hole in it, by using Pythagorean's theorem (the square of the hypotenuse is equal to the sum of the squares of the other two sides).
Larrie Lane
Registered User
Join date: 9 Feb 2007
Posts: 667
03-12-2008 17:20
From: Rolig Loon
It's 0.95, the percentage expressed as a decimal. All Void is doing is getting the hypotenuse of that triangle in the corner (the distance between the corner of the prim and the corner of the hole in it, by using Pythagorean's theorem (the square of the hypotenuse is equal to the sum of the squares of the other two sides).


It is correct Rolig, but I prefer not to to use Py's theory for something of this nature as it will not be correct (In theory yes and in RL yes, in SL no).
As I pointed out, if a texture is designed using 9.5 as a scale of measurement for a hollowed prim of 10x10x10 the texture would overlap the walls or sides and repeats and offsets would have to be used. See my earlier post.

To start with the hollow is actually 94.9999 recurring (not the 95.00 but this is irrelevant for this exercise)
The thickness of each of the 4 sides is actually 0.250250
So taking the total thickness of the 2 sides which is 0.5005 from the the 10 metre width the distance would be 9.4995.

As previously mentioned most people will only get 9.5 as round figure from the edit menu. So designing your texture will give you the overlap of approx 1.5-2cm because you have designed the texture over 4 sides.

The example I was giving would allow you to apply a texture without having to use repeats but possibly an offset of between 0.001 and 0.005 in one direction.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
03-12-2008 20:36
Hmmmmmm..... I can see that, but Void's formula gets you darn close ..... close enough, in fact, that it seems like you could make the final microadjustments in repeats and offsets by eye without a lot of trouble. Not that I've tried it myself, of course. ;-)
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
03-12-2008 20:38
one problem, there is a hidden edge in an uncut cube, it spans the distance of the cut start edge of both start and end sides (doesn't happen on spheres or cylinders IIRC),
so that an inner cube with .95 holow needs a texture repeat of ~4.2 to add a single repeat to each inner face...

while there is a rounding error in sl's implementation, it is not apparent at all levels and the math you've presented is a bit off, as thickness at .95 hollow even represented .94995, .05005 for both opposite walls, leaving a distance of 9.4995 on the inner walls of a 10m cube

the formula previoulsy stated works by expanding the scale of the inner walls to 1.0 rather than relying on repeats per meter. it actually shortcuts some of the math by doing both hidden portions at once instead of calculating them separately by getiing the difference between the cross of the outside, and the cross of the inside effectively getting oth the initial hidden part and the ending hidden part at once.

the long way would be
1 + (sqrt(((1 / hollow - 1) / 2)^2 * 2) * 2) * 4 * horizontal_repeats_per_face

inserting .95 with 1 repeat per face in the original formula gets
(sqrt((1 / .95 - 1)^2 * 2) + 1) * 4
(sqrt((1.05263 - 1)^2 * 2) + 1) * 4
(sqrt((0.05263)^2 * 2) + 1) * 4
(sqrt(0.002770 * 2) + 1) * 4
(sqrt(0.00554) + 1) * 4
(0.074431 + 1) * 4
1.074431 * 4
= 4.297724 (4.297729 actually)

the same operation set on .94995 = 4.298043

a difference of 0.000314 which at a 10m cube translates to 0.00314% of around 3-4mm

the formula at the very least gets you in the ball park, and somwhere to start, which you can tweak from if it's no perfect

alternate formula:
(sqrt( 2 ) - sqrt( hollow^2 * 2 ) + 1) * 4 * repeats_per_face = horizontal repeats
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
03-12-2008 20:59
while there is a rounding error in sl's implementation, it is not apparent at all levels (blame binary floats)

the formula previoulsy stated works by expanding the scale of the inner walls to 1.0 rather and using scale than relying on repeats per meter. it actually shortcuts some of the math by doing both hidden portions at once instead of calculating them separately by getiing the difference between the cross of the outside, and the cross of the inside effectively getting both the initial hidden part and the ending hidden part at once.

the long way would be
((sqrt(((1 / hollow - 1) / 2)^2 * 2) * 2) + 1) * 4 * horizontal_repeats_per_face

inserting .95 with 1 repeat per face in the original formula gets
(sqrt((1 / .95 - 1)^2 * 2) + 1) * 4
(sqrt((1.05263 - 1)^2 * 2) + 1) * 4
(sqrt((0.05263)^2 * 2) + 1) * 4
(sqrt(0.002770 * 2) + 1) * 4
(sqrt(0.00554) + 1) * 4
(0.074431 + 1) * 4
1.074431 * 4
= 4.297724 (4.297729 actually)

the same operation set on .94995 = 4.298043
a difference of 0.000314 which at a 10m cube translates to 0.00314 or around 3-4mm not 1-2cm

alternate formula based on repeats per meter:
(sqrt( 2 ) - sqrt( hollow_percent^2 * 2 ) + 1) * 4 * repeats_per_face * cube_side_in_meters

if someone has a better formula I'm open to suggestion
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Robin Sojourner
Registered User
Join date: 16 Sep 2004
Posts: 1,080
03-14-2008 08:49
Oddly enough, I have a book in-world, in my Texture Library, that has the formulas and things for all the prims, with pictures and everything. (And not a square root among them. yet they all work perfectly.) :D

It's free to read, but there's a nominal Linden fee to carry a copy home with you, so it's always ready, right there in world, when you need it. (I use it myself, all the time. I can't remember this stuff - it's all numbers. :D )

You can find the Texture Library right next to the Texture Tutorial, Livingtree (127, 99, 25).
http://slurl.com/secondlife/Livingtree/127/99/25/

Hope this helps!
_____________________
Robin (Sojourner) Wood
www.robinwood.com

"Second Life ... is an Internet-based virtual world ... and a libertarian anarchy..." Wikipedia
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
03-14-2008 15:54
cool, will go look soon as I get my vid card fan replaced (so I don't cook it), I'd love to see the formulas and how they're derived =)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -