Loading Image trouble

enrico
2011-05-30
2013-06-12
  • enrico
    enrico
    2011-05-30

    hi, i'm new in the forum.
    i want to load on a page a simple box with an image on it,
    i can see with any problem the box with a color i choose.
    but when i try to apply the image texture i see nothing change.
    there is a particular way to do this?
    in the examples that i found apparently there isn't, should be very easy, but i can't see my image texture :(

     
  • enrico
    enrico
    2011-05-30

    this is the code i made

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
            <title>Hello World</title>
            <link rel="stylesheet" type="text/css" href="x3dom.css" />
            <script type="text/javascript" src="x3dom.js"></script>
        </head>
           
    <body>
        <h1>XHTML Hello World</h1>
            <X3D xmlns="http://www.web3d.org/specifications/x3d-namespace" width='50%' height='50%'>
              <Scene>
                 <Shape>
                    <Appearance>
                        <Material/>
                        <ImageTexture url='./myImage.jpg'/>
                    </Appearance>
                    <Box DEF='box'/>
                 </Shape>
              </Scene>
            </X3D>
        </body>
    </html>
    
     

  • Anonymous
    2011-06-07

    Hi, i hadn't read about nonPOT2, and will look at it.

    What i had as dirty workaround was to have only 1024x768px images (don't ask me why, but this worked and any other size didn't…)

     
  • j milo taylor
    j milo taylor
    2011-12-21

    hi there,

    in my browser both these examples are working (http://x3dom.org/x3dom/example/x3dom_nonPO2Texture.html) - i am having real problems working with imagetexture of any kind - win 7 64 chrome- no image displaying - is there a bug?

     
  • Johannes Behr
    Johannes Behr
    2011-12-21

    Is your image and html data on the same server?

    regards
    johannes

     
  • j milo taylor
    j milo taylor
    2011-12-21

    hi johannes,

    yes all hosted here http://suborg.net/x3d-imagetexturetest.html (image in a sub dir) shown by way of example below the x3d.
    i am totally confused by this - any thoughts?
    best regards,
    jmt

     
  • steve smith
    steve smith
    2011-12-22

    Why do you have './' at the start of your image url ?

    ss

     
  • j milo taylor
    j milo taylor
    2011-12-22

    @zanzibarneon - i presume your question is directed at enricuzi?
    you are referring to this line? <ImageTexture url='./myImage.jpg'/>

     
  • steve smith
    steve smith
    2011-12-22

    Yes

    If the images are in the same directory as the html file then the path then the syntax would be

    <ImageTexture url='"myImage.jpg'"   />

     
  • j milo taylor
    j milo taylor
    2011-12-22

    hi steve -yes i have the images in a sub directory as described by

    <ImageTexture repeatS='false' repeatT='false' url='"opensoundx3d/cable.jpg"'/>  in  http://suborg.net/x3d-imagetexturetest.html

    the images are in the correct place (as shown by the image shown below the x3d - the same as should be displayed on the x3d box .

    i don't get why its not showing? something to do with the server? something called CORS or something like that?

    any ideas? anyone? seems so simple - yet i have tried everything i can think of

     
  • steve smith
    steve smith
    2011-12-23

    If you send me a link to a zip I will try it on my server.

     
  • j milo taylor
    j milo taylor
    2011-12-27

    hi zanzibarneon (steve?),
    that's super kind of you - i've posted a zip of html (x3dom) and image to:
    http://suborg.net/imagetexture.zip
    can u see anything wrong with this?
    best regards,
    -jmt

     
  • Steven
    Steven
    2011-12-27

    Ähm, did you simply forget to place the x3dom.js into your folder? You are pointing to a local file:

     <script type="text/javascript" src="x3dom.js"></script>
    

    After adding the file, the texture is displayed well on the little cube! :-)
    Greets,
    Steven

     
  • j milo taylor
    j milo taylor
    2011-12-27

    hi steven,
    thankyou for trying it out. sadly, x3dom.js is in my folder in the location pointed to by the code - ummm???

     
  • steve smith
    steve smith
    2011-12-28

    Hi,

    I tried your model and it works ok for me in the the latest Chrome v16.

    But it didn't work in Firefox Beta (v10).

    I copied the latest stable x3dom 1.3 files do the same location as x3d-imagetexturetest.html.
    These where x3dom.js, x3dom.css, x3dom.swf

    Steve