X3D로 변환하려는 VRML 코드가 있습니다. 코드는 다른 반경과 색상으로 구체를 정의해야 나중에 좌표를 인수로 제공하여 인스턴스화 할 수 있습니다.X3D : PROTO가 VRML에서 변환되지 않았습니다.
먼저 another question에 제안 된 online converter을 사용한 다음 블렌더에서 열어 확인했지만 4 대신 1 개의 구만 표시합니다. 인터넷 검색으로 찾은 다른 유사한 예와 비교해 보았습니다. 왜 이렇게했는지에 대한 차이점이나 단서가 없습니다. 일부 필드를 변경하여 예와 비슷해 보았습니다. field accessType
에서 initializeOnly
까지의 정보는 <X3D ...>
에서 profile="Interchange" version="3.2" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-3.2.xsd"
까지입니다. 나는 또한 을 <children>
안에 넣으려고했지만, 모든 경우에 단지 하나의 구를 보여줍니다.
이 내가 X3D로 변환 할 VRML 코드의 단순화 된 버전입니다 것은 :
#VRML 2.0 utf8
PROTO Copper [ exposedField SFVec3f xyz 0 0 0 ] {
Transform {
translation IS xyz
children [
Shape {
appearance Appearance {
material Material { diffuseColor 0.78 0.5 0.2 }
}
geometry Sphere { radius 1.32 }
}
]
}
}
Copper { xyz 0.0 0.0 0.0 } # 0
Copper { xyz 0.0 1.8 1.8 } # 1
Copper { xyz 1.8 0.0 1.8 } # 2
Copper { xyz 1.8 1.8 0.0 } # 3
이 내가 컨버터에서 무엇을 얻을 수 있습니다 : 불행하게도
<?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 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' profile='Full' version='3.0' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.0.xsd'>
<Scene DEF='scene'>
<ProtoDeclare name='Copper'>
<ProtoInterface>
<field accessType='inputOutput' name='xyz' type='SFVec3f' value='0 0 0'/>
</ProtoInterface>
<ProtoBody>
<Transform>
<Shape>
<Appearance>
<Material diffuseColor='0.78 0.5 0.2'/>
</Appearance>
<Sphere radius='1.32'/>
</Shape>
<IS>
<connect nodeField='translation' protoField='xyz'/>
</IS>
</Transform>
</ProtoBody>
</ProtoDeclare>
<Copper/>
<Copper xyz='0 1.8 1.8'/>
<Copper xyz='1.8 0 1.8'/>
<Copper xyz='1.8 1.8 0'/>
</Scene>
</X3D>