我有几十个X3D文件,我的目标是使用XML解析器将它们放入Java应用程序中。但是,我知道这听起来可能很愚蠢,但是如何将.x3d
文件转换为.xml
文件呢?.x3d
文件是从一个朋友那里提供给我的,目的是制作一个3D模型查看器。我做了一些研究,但我不知道下面的代码在将X3D加载到XML时是否正确。
<?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>
发布于 2017-09-04 05:52:15
您还可以将.x3d文件重命名为.xml,如果这有助于原生XML工具处理它的话。
XML还以规范的X3D形式提供了每个场景的副本,这支持XML安全工具的应用,用于XML数字签名(身份验证)和XML加密(隐私)。有关这些主题的更多信息,请访问
发布于 2016-02-01 01:38:56
X3D是一种基于XML的文件格式,所以是的:您将能够使用(Java)解析器加载X3D文件。
https://stackoverflow.com/questions/35116921
复制相似问题