[x3d-public] Texture Coordinate problem with x3dom
spc
satan_petit_coeur at newgenweb.ch
Wed Aug 5 11:27:53 PDT 2020
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
More information about the x3d-public
mailing list