首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >X3D到XML的转换

X3D到XML的转换
EN

Stack Overflow用户
提问于 2016-02-01 01:31:37
回答 2查看 269关注 0票数 1

我有几十个X3D文件,我的目标是使用XML解析器将它们放入Java应用程序中。但是,我知道这听起来可能很愚蠢,但是如何将.x3d文件转换为.xml文件呢?.x3d文件是从一个朋友那里提供给我的,目的是制作一个3D模型查看器。我做了一些研究,但我不知道下面的代码在将X3D加载到XML时是否正确。

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN"
  "http://www.web3d.org/specifications/x3d-3.0.dtd">

<X3D profile="IMMERSIVE" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" 
xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-   3.0.xsd">
    <head>
        <meta name='filename' content='RedSphereBlueBox.x3d'/>
    </head>
        <Scene>
            <Transform>
                <NavigationInfo headlight='false' 
         avatarSize='0.25 1.6 0.75' type='EXAMINE'/>
                <DirectionalLight/>
                <Transform translation='3.0 0.0 1.0'>
                    <Shape>
                        <Sphere radius='2.3'/>
                        <Appearance>
                            <Material diffuseColor='1.0 0.0 0.0'/>
                        </Appearance>
                    </Shape>
                </Transform>
                <Transform translation='-2.4 0.2 1.0' rotation='0.0 0.707 0.707 0.9'>
                <Shape>
                    <Box/>
                    <Appearance>
                        <Material diffuseColor='0.0 0.0 1.0'/>
                    </Appearance>
                </Shape>
            </Transform>
        </Transform>
    </Scene>
</X3D>
EN

回答 2

Stack Overflow用户

发布于 2017-09-04 05:52:15

您还可以将.x3d文件重命名为.xml,如果这有助于原生XML工具处理它的话。

XML还以规范的X3D形式提供了每个场景的副本,这支持XML安全工具的应用,用于XML数字签名(身份验证)和XML加密(隐私)。有关这些主题的更多信息,请访问

  • http://www.web3d.org/x3d/content/examples/X3dResources.html#Examples
  • view-source:http://www.web3d.org/x3d/content/examples/HelloWorldCanonical.xml
  • http://www.web3d.org/documents/specifications/19776-3/V3.3/Part03/concepts.html#X3DCanonicalForm
  • http://www.web3d.org/x3d/content/examples/X3dResources.html#Security
票数 2
EN

Stack Overflow用户

发布于 2016-02-01 01:38:56

X3D是一种基于XML的文件格式,所以是的:您将能够使用(Java)解析器加载X3D文件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35116921

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档