[x3d-public] Texture Coordinate problem with x3dom

Andreas Plesch andreasplesch at gmail.com
Wed Aug 5 12:36:13 PDT 2020


Hello Thomas,

https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter18TextureMapping/Figure18_20bTextureCoordinatePizzaSliceX3dom.xhtml

shows the texture correctly.

I think the difference to your webpage test is that you are using html
encoding while the example above is using xhtml encoding.

With html, you have to use explicit closing tags: <TextureCoordinate
..></TextureCoordinate>; for all tags.

Please feel free to use the x3dom-user mailing list, the issue
facility on x3dom github, or x3dom gitter, for further questions.

Andreas

> Date: Wed, 5 Aug 2020 20:27:53 +0200
> From: spc <satan_petit_coeur at newgenweb.ch>
> To: x3d-public at web3d.org
> Subject: [x3d-public] Texture Coordinate problem with x3dom
> Hi all !
>
> I have a problem with x3dom regarding texture coordinates.
>
> I've reproduced this example (dated 1997!) :
> https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter18TextureMapping/Figure18_20bTextureCoordinatePizzaSliceIndex.html
>
> Here's below the webpage test:
>
> <!DOCTYPE html>
> <html lang='en'>
> <head>
> <title>test</title>
> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
> <script type='text/javascript'
> src='https://www.x3dom.org/download/x3dom.js'> </script>
> <link rel='stylesheet' type='text/css'
> href='https://www.x3dom.org/download/x3dom.css'></link>
> </head>
> <body>
> <h1>Test</h1>
> <x3d width='500px' height='400px'>
> <Scene>
> <viewpoint position="1 1 3" orientation="1 0 0 -0.4"
> fieldOfView="1"></viewpoint>
> <Shape>
> <Appearance><ImageTexture url='"pizza.jpg"'/></Appearance>
> <IndexedFaceSet solid='false' texCoordIndex='0, 1, 2, 3, 4, 5'
> coordIndex='0, 1, 2, 3, 4, 5, -1'>
> <Coordinate point='0.5 0 0.5, 0.88 0 1.42, 1.06 0 1.33, 1.21 0 1.21,
> 1.33 0 1.06, 1.42 0 0.88'/>
> <TextureCoordinate point='0.5 0.5, 0.68 0.07, 0.76 0.11, 0.83 0.17, 0.89
> 0.24, 0.93 0.32'/>
> </IndexedFaceSet>
> </Shape>
> </Scene>
> </x3d>
> </body></html>
>
> The problem is that x3dom is simply ignoring the TextureCoordinate,
> resulting a wrong mapping.
>
> The image link working is
> https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter18TextureMapping/pizza.jpg
>
> I've tried to put TextureCoordinate before Coordinate, but then it
> fails. I've tried previous versions of x3dom.js, but no luck. I've tried
> on Firefox and Chromium. Thou I've tested the code successfully in
> Titania. But I'd like to use x3dom for the web..
>
> Thank you for you help !
>
> Thomas
>
>
>
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
> ------------------------------
>
> End of x3d-public Digest, Vol 137, Issue 4
> ******************************************



-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list