Hello folks. :) So, I'm working on osgWidget::Frame (a 3x3 table-like Window class that has 4 corners, 4 borders, and a center viewable area).
What I'm wanting to do is borrow the World of Warcraft (we should
remember here that they have almost 10 million users and an unfathomably
large UI modding community from which I derive much of my
inspiration :)) method of defining a Frame's border and corner textures.
It's mostly straightforward:
1. The user creates an image (texture) which has a width that is
a multiple of 8. 8 is important here because there are 8
textureable regions (the 4 corners and the 4 borders).
2. The first border regions (left and right borders) are easy to
implement, because they simply implement a vertical texture
repeat, and we always span the entire height of the texture
for each region.
3. The next border regions (top and bottom) are more
troublesome, because there's no straightforward way to
implement this kind of repeat in OpenGL that I can think
of.
4. The corners are easy, of course, because they don't
require any kind of texture repeat.
Take a look at the attached image I mocked up to help illustrate the
problem.
According to the WOW API documentation, the artist is reminded that the
top and bottom regions should be rotated 90 CW, and you'll be able to
see this in the example image. However, I'm not entirely sure how I can
implement this aspect of the texturing process in OSG. I can see from a
high-level how, if you rotate the entire texture 90 CW, you could use
horizontal texture repeat to achieve the desired effect. This doesn't,
unfortunately, give me any hints as to how to actually implement this in
osgWidget.
Does anyone have any advice how I could do this? I know the solution
will involve some use of a texture Matrix, but every use of it I can
think of would involve creating a custom drawImplementation, which is
going to be a lot of work.
<<attachment: frame-theme.png>>
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

