Use different images on GLCube's sides

Help
dimg
2011-01-17
2013-03-15
  • dimg

    dimg - 2011-01-17

    Hi all,
    please help with following :
    I have a GLCube. If I use Material -> Texture -> Image to load an image then this image is applied the same for all enabled sides.
    What I want is to apply different images per side. Please help how I can do this and if possible send some code sample or some link with information about that.
    Thank you.

     
  • YarUnderoaker

    YarUnderoaker - 2011-01-17

    Variants:
    1) Six plane with different material to construct cube
    2) Cube textured by cubemap with spherical texture generation

     
  • dimg

    dimg - 2011-01-17

    Thank you very much for replying yarunderoaker.
    How can I use the first solution with six plane ?
    I mean, after I assign a texture to a plane, then how can I assign a plane to a specific side of cube ?
    Is there any example I can see ?
    If you have any simple code sample to post, or a link to see an example, I would be grateful.

     
  • YarUnderoaker

    YarUnderoaker - 2011-01-18

    Create six TGLPlane as child of TGLDummyCube. Then adjust its direction and position. Assign materials. That's all.
    I recommend to you to see and learn standart demos.

     
  • dimg

    dimg - 2011-01-18

    Thank you again for replying.
    I have already checked some demos but could not really find answer to specific thing I am looking for.
    And now, still after your last answer, I cannot understand how to put specific GLPlane to specific side of cube.
    For example, if I want only to have a cube that has an image with "1" on its top side and "2" on its bottom side and all other 4 sides to have no texture on them but only the predefined cube's color, what I must do ?
    Sorry for many questions…

     
  • dimg

    dimg - 2011-01-18

    Thanks - god bless you

     
  • dimg

    dimg - 2011-01-19

    Hi, all is OK with solution you sent but now I have another question :
    I use a GLCylinder and apply a texture on it by loading an external jpg image. This image is displayed both in the outer perimeter of the cylinder but also on top and bottom sides. How I put different images on top and bottom sides of cylinder, other than the one that is used in outer perimeter ?
    Thank you in advance.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks