2015-12-23 30 views
-1

我有這段代碼,它不起作用。我該如何解決它?X3Dom在文本中設置ImageTexture

如何更改文本的大小?

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

+0

不要將整個內容設置爲粗體(直接在一行之下添加----使得它上面的文本看起來像標題)。另外,*它不工作*不是一個好問題陳述。你應該指出你期望它如何工作,並指出目前正在發生的事情。如果您收到任何錯誤消息,請將其作爲問題的一部分。 – Harry

回答

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> 
+0

這是一個家庭作業。 我必須使用ImageTexture創建三維文字!我認爲這是不正確的。 - –

+0

沒有直接的方式來創建三維文字。您需要將每個字母創建爲3d形狀,然後使用ImageTexture將紋理附加到它上面。 – CpS

+0

以及我如何做到這一點? :S我只需要4個數字..... –