Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

texturing a hexagon

Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
01-29-2005 22:37
I'm trying to build a hexagon-shaped object (a "hexagonal cylinder" or an extruded hexagon, if you want me to be precise), and I'd like to be able to texture the hexagonal face. I built a hexagon out of two box prims, using top-size and a little bit of geometry.

That worked well, but texturing it seems to be a problem. The texture is bent in a way I can't really understand. Is it possible to compensate for the bend in my texture, so that, when applied, it looks right?

See attachments for pictures of what I'm dealing with. The texture applied to the face is a simple set of black and white stripes -- the same texture on all sides.
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
01-30-2005 02:00
hehe that actually looks pretty cool but yeah, boxes with smaller tops screw up the textures like mad. personally i'd try making a hexagonal texture with the non hexagon parts transparent and put it on the top of a cylinder, scale it bigger than your hexagon and try to line them up so it looks like the surface. actually that's a sucky idea so don't do that. :D
billy Madison
www.SLAuctions.com
Join date: 6 Jun 2004
Posts: 2,175
01-30-2005 02:01
Wow.
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
01-30-2005 03:04
That was our backup plan, Zuzi, but it leads to all sorts of nastiness with layering alphas and such when you try to put a bunch of them near each other.

I did finally come up with a solution to this... you have to take a hexagon-shaped image and bend and twist it into a rectangle shape. If anyone happens to need to do this, IM me.
billy Madison
www.SLAuctions.com
Join date: 6 Jun 2004
Posts: 2,175
01-30-2005 03:05
yay
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
01-30-2005 03:48
glad ya found a solution. can you post a pic of what you're talking about?
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
01-30-2005 21:34
Ok, the first attachment shows a hexagon-shaped image that I want to be able to put on a pair of prims. The prims are constructed using top size of 0.5, 1.732m for the y axis and 2.00m for the x axis (resulting in two trapezoids that are placed together to form a perfect hexagon). The second attachment shows what the texture has to look like in order to get the desired image to appear right on the hexagon face. The diagonal lines are a reference point, showing how the image has to be bent and skewed in order to get the resulting texture. To do this, I cut the image into those four triangles, skew them (in PSP... I don't know what the corresponding command in PS is) and stretch them until they fit in the rectangular texture.

I'm actually storing the textures for both prims in a single texture file, which, along with saving me upload costs, also helps remove any ugly seam between the two prims. I set the vertical texture repeats to 0.5 and the offset to 0.25 so that each prim gets its half of the texture. The result is that the hexagon-shaped prim has that hexagon-shaped image I started with, although it ends up just a little blurry due to the stretching. Really, the blurring is not too bad at all.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
01-30-2005 22:29
Awesome job on that, Lex.
_____________________
.

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.
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
01-30-2005 23:37
that's very cool. thanks for sharing the trick. :D
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
01-31-2005 00:10
No prob :) I'm sure others will want to do this in the future, and I think a few have in the past and haven't found a way. I think this technique can be applied to other shapes that texture weirdly.
Chandra Page
Build! Code. Sleep?
Join date: 7 Oct 2004
Posts: 360
01-31-2005 13:26
Thank you for the explicit and well-explained tip, Lex. I use hexagons in my store's logotype, and I ran across this problem when I tried to make hexagonal wall displays. I'll have to fire up Photoshop and give this a try.
_____________________
Come visit the In Effect main store and café
Drawbridge (160, 81)
Particle effects, fashion, accessories, and coffee!
On the Web at SL Exchange and SL Boutique
Strangeweather Bomazi
has no clever catchphrase
Join date: 29 Jan 2005
Posts: 116
Thank you!
02-22-2005 07:12
This thread was a godsend! I was working with some chair arms that were skewed trapezoids, and the textures looked like total cr*p. Thanks for the workaround.
_____________________
Strangeweather Designs - classic casual home furnishings
Now open in Mochastyle, Mocha (13, 115)
Spider Mandala
Photshop Ninja
Join date: 29 Aug 2003
Posts: 194
02-22-2005 11:06
this can be avoided relatively easily with the use of one extra prim, instead of using two topsized cubes use two cut cubes and a single solid cube something like this:
<| [] |>

when a cube is cut, the face that gets "cut" will texture fine. If this needs more explanation contact me in world but its pretty straightforward
_____________________
"There's an old saying in Tennessee, I know it's in Texas, probably in Tennessee, that says, fool me once... shame on... shame on you. You fool me, you can't get fooled again."
-George W. Bush
East Literature Magnet School, Nashville, Tennessee, Sep. 17, 2002
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
02-22-2005 11:52
WARNING !!!

Remember that the current (and loooong-standing) issue with texturing topsized cubes is one that MAY BE FIXED in the near future. I know I, for one, have been asking this to be fixed for ages.

When it IS fixed, such attempts to work around the bug may backfire, and you'll need to retexture again.

[ I do so hope this is fixed soon... And the issue of texturing each side of a Tube prim differently. (You can't!) ]
_____________________
~ Tiger Crossing
~ (Nonsanity)
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
02-23-2005 08:55
Spider, your solution didn't work for me, because I was doing a project that required a bunch of hexagons (37). As it is, using two prims for each was annoying...but acceptable. 3 wasn't. :)

As for your note, Tiger... well, I'll deal with that when it happens... but I'd be happy to drop the resolution of my images and retexture, it'll make things look better :)
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
01-04-2006 21:28
Note for those searching, this tool may help: /109/b4/80486/1.html
Robin Sojourner
Registered User
Join date: 16 Sep 2004
Posts: 1,080
01-04-2006 23:52
I know this is an old thread, but Tiger, if you're still out there, I wouldn't hold my breath waiting for a "fix" for this one.

The problem occurs because the cubes are described with only 8 points, or vertices (one in each corner.) That's not enough to hold the UV Mapped texture in place, so it kind of folds in the middle.

In order to fix it, SL would have to add a bunch more points to the cube. And that would cause a whole host of other difficulties, since render time is largely determined by polygons that need rendering. Since more points means more polygons, and lots more point means lots more polygons, I don't expect this to happen.

Games always use the fewest polys they can get away with, for obvious reasons. :D
_____________________
Robin (Sojourner) Wood
www.robinwood.com

"Second Life ... is an Internet-based virtual world ... and a libertarian anarchy..." Wikipedia