x3dom / x3dom

X3DOM. A framework for integrating and manipulating X3D scenes as HTML5/DOM elements.
http://x3dom.org
Other
813 stars 271 forks source link

TextureTransform is ignored #1239

Closed ChristopheF closed 1 year ago

ChristopheF commented 1 year ago

In my tests the TextureTransform tag is ignored despite the 'fully implemented' status visible here. Below is my sample HTML page where the TextureTransform tag should apply a 90° (pi/2) rotation to the texture but the texture is still applied without any rotation (tested with latest versions of Edge/FireFox/Chrome). When I open the same X3D code in the Octaga player, I do see the texture rotation effect being applied. Is this a bug in X3DOM or am I doing something wrong?

<html>
    <head>
        <script type='text/javascript' src='http://www.x3dom.org/download/x3dom.js'></script>
        <link rel='stylesheet' type='text/css' href='http://www.x3dom.org/download/x3dom.css'></link>
    </head>
<body>
    <X3D>
        <Scene>
            <Shape>
                <Appearance>
                    <ImageTexture url='Texture.png'/>
                    <TextureTransform rotation='1.57' />
                </Appearance>
                <IndexedFaceSet coordIndex='0 1 2 3' solid='false'>
                    <Coordinate point='-2 2 0 2 2 0 2 -2 0 -2 -2 0'/>
                </IndexedFaceSet>
            </Shape>
        </Scene>
    </X3D>
</body>
</html>
andreasplesch commented 1 year ago

Please try full closing tags: </TextureTransform>

ChristopheF commented 1 year ago

Thanks a lot, this works around my issue! I thought both ways to close a tag were valid XML syntax.

andreasplesch commented 1 year ago

Yes, both are valid xml. But you will need to serve the html as xhtml for a web browser to recognize the content as xml, in the filename and probably also in the mime type. html is not xml and has a different syntax, albeit similar.

Inlines with a .x3d extension are always parsed as xml.

ChristopheF commented 1 year ago

Thank you for that clarification. I was not aware of that difference between html/xhtml. I did not suspect this could an issue because in my sample above I also closed other tags in the same way and they worked fine. This makes perfect sense now.