我有这个代码而且不起作用。我该如何解决?
如何更改文字大小?
<x3d width='800px' height='400px'>
<scene>
<shape>
<Appearance>
<ImageTexture url='1.jpg'/>
</Appearance>
<Text string='3'>
<FontStyle style='BOLD' />
</Text>
</shape>
</scene>
答案 0 :(得分:0)
您无法在ImageTexture上设置字体大小。无论如何,这里是一个创建纹理立方体(Box)并在其前面放置Text形状的示例。
<?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>