Jeremy,

El Lunes 13 Octubre 2008ES 14:22:02 Jeremy Moles escribió:
> 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.

there's no need for a texture Matrix, just set the texture coordinates 
accordingly. In this case, you must swap u and v for the top and bottom 
parts. I have done this in blender and exported the result into an osg for 
you to inspect. I have also put some little coloured marks on the texture in 
order to make sure they are repeating. I have also available my .blend if you 
want it.

Hope this helps and keep the good work!

Alberto

<<attachment: frame-theme.png>>

Group {
  name "frame.obj"
  nodeMask 0xffffffff
  cullingActive TRUE
  num_children 1
  Geode {
    name "Plane"
    nodeMask 0xffffffff
    cullingActive TRUE
    num_drawables 1
    Geometry {
      DataVariance STATIC
      StateSet {
        DataVariance STATIC
        rendering_hint DEFAULT_BIN
        renderBinMode INHERIT
        Material {
          ColorMode OFF
          ambientColor 0 0 0 1
          diffuseColor 0.8 0.8 0.8 1
          specularColor 0.8 0.8 0.8 1
          emissionColor 0 0 0 1
          shininess 0
        }
        textureUnit 0 {
          GL_TEXTURE_2D ON
          Texture2D {
            file "frame-theme.png"
            wrap_s REPEAT
            wrap_t REPEAT
            wrap_r REPEAT
            min_filter LINEAR_MIPMAP_LINEAR
            mag_filter LINEAR
            maxAnisotropy 1
            borderColor 0 0 0 0
            borderWidth 0
            useHardwareMipMapGeneration TRUE
            unRefImageDataAfterApply TRUE
            internalFormatMode USE_IMAGE_DATA_FORMAT
            resizeNonPowerOfTwo TRUE
          }
        }
      }
      useDisplayList TRUE
      useVertexBufferObjects FALSE
      PrimitiveSets 8
      {
        DrawElementsUShort TRIANGLE_STRIP 4
        {
          1 2 0 3 
        }
        DrawElementsUShort TRIANGLE_STRIP 4
        {
          7 4 6 5 
        }
        DrawElementsUShort TRIANGLE_STRIP 4
        {
          31 28 30 29 
        }
        DrawElementsUShort TRIANGLE_STRIP 4
        {
          27 24 26 25 
        }
        DrawElementsUShort TRIANGLE_STRIP 4
        {
          23 20 22 21 
        }
        DrawElementsUShort TRIANGLE_STRIP 4
        {
          19 16 18 17 
        }
        DrawElementsUShort TRIANGLE_STRIP 4
        {
          13 14 12 15 
        }
        DrawElementsUShort TRIANGLE_STRIP 4
        {
          9 10 8 11 
        }
      }
      VertexArray Vec3Array 32
      {
        -0.5 1 -0
        -1 1 -0
        -1 0.5 -0
        -0.5 0.5 -0
        1 1 -0
        0.5 1 -0
        0.5 0.5 -0
        1 0.5 -0
        -0.5 -0.5 0
        -1 -0.5 0
        -1 -1 0
        -0.5 -1 0
        1 -0.5 0
        0.5 -0.5 0
        0.5 -1 0
        1 -1 0
        0.5 1 -0
        -0.5 1 -0
        -0.5 0.5 -0
        0.5 0.5 -0
        1 0.5 -0
        0.5 0.5 -0
        0.5 -0.5 0
        1 -0.5 0
        0.5 -1 0
        0.5 -0.5 0
        -0.5 -0.5 0
        -0.5 -1 0
        -1 -0.5 0
        -0.5 -0.5 0
        -0.5 0.5 -0
        -1 0.5 -0
      }
      NormalBinding PER_VERTEX
      NormalArray Vec3Array 32
      {
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
        0 0 1
      }
      TexCoordArray 0 Vec2Array 32
      {
        0.875 0
        1 0
        1 1
        0.875 1
        0.75 0
        0.875 0
        0.875 1
        0.75 1
        0.625 0
        0.75 0
        0.75 1
        0.625 1
        0.5 0
        0.625 0
        0.625 1
        0.5 1
        0.251894 4.26562
        0.251894 -0.015625
        0.373106 -0.015625
        0.373106 4.26562
        0.25 0
        0.125 0
        0.125 4.25
        0.25 4.25
        0.5 0
        0.375 0
        0.375 4.375
        0.5 4.375
        0 0
        0.125 0
        0.125 4.25
        0 4.25
      }
    }
  }
}
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to