-1

我有这个代码,它不起作用。我该如何解决?

以及如何更改文本的大小?

<x3d width='800px' height='400px'>
<scene>
       <shape>
              <Appearance>
                    <ImageTexture url='1.jpg'/>
                </Appearance>
                <Text string='3'>
                    <FontStyle style='BOLD' />
                </Text>
       </shape>
</scene>

4

1 回答 1

0

您不能在 ImageTexture 上设置字体大小。无论如何,这是一个创建纹理立方体(Box)并将文本形状放在它前面的示例。

<?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>
<Scene>
<Group>
  <Transform>
    <Shape>
     <Appearance>
      <ImageTexture url='1.jpg'/>
     </Appearance>
<Box/>
    </Shape>
    <Transform translation="0 0 1">
      <Shape>
       <Appearance>
<Material/>
       </Appearance>
       <Text string='"This is a text"'>
        <FontStyle family='"SANS"' justify='"MIDDLE"' size="1.5" style="BOLD"/>
       </Text>
      </Shape>
    </Transform>
  </Transform>
</Group>

</Scene>
</X3D>
于 2015-12-24T08:28:00.277 回答