2016-12-19 4 views
0

cynlinderの最後に円錐を追加することで矢印を1つ作成できることはわかっています。このようなもの:X3D(OM)に矢印の設定フィールドを作成します。

<Shape> 
<Cylinder DEF='ArrowCylinder' radius='.025' top='false'/> 
<Appearance DEF='Green'> 
<Material diffuseColor='.1 .6 .1' emissiveColor='.05 .2 .05'/> 
</Appearance> 
</Shape> 
<Transform translation='0 1 0'> 
<Shape> 
<Cone DEF='ArrowCone' bottomRadius='.05' height='.1'/> 
<Appearance USE='Green'/> 
</Shape> 
</Transform> 

代わりに、X3DOMでグリフ/ベクトルフィールドのようなものを表示したいのですが?明らかに、各矢印がこのように定義されている全体の矢印を作成すると、エレガントなソリューションにはなりません...

答えて

0

IndexedFaceSetノードを使用して独自の矢印を作成し、 、代わりにあなたはもちろんの1つのIDの下でグループ矢印のセットは、することができます:ここでは(2-D)の例である:

<x3d width="400px" height="400px"> 
    <scene> 
    <group id="arrow">  
     <shape> 
      <appearance> 
      <material diffuseColor="0.25 0.75 0.755"></material> 
      </appearance> 
      <IndexedFaceSet solid="false" coordIndex="0 1 2 3 0 -1"> 
      <coordinate point="0 0 0 1 0 0 1 1 0 0 1 0"> 
      </coordinate> 
      </IndexedFaceSet> 
     </shape> 
     <shape> 
     <appearance> 
      <material diffuseColor="0.25 0.75 0.755"></material> 
     </appearance> 
     <IndexedFaceSet solid="false" coordIndex="0 1 2 3 0 -1"> 
      <coordinate point="1 -0.5 0 2 0.5 0 2 0.5 0 1 1.5 0"> 
      </coordinate> 
     </IndexedFaceSet> 
     </shape> 
    </group> 
    </scene> 
</x3d> 

一つの大きな利点は、あなたがポイントの量を減らすことになる/ロットを描きます、あなたは膨大な量の矢を使用すると、パフォーマンスを得ることができます。

+0

もちろん、1つのIndexedFaceSetで配列シェイプを作成することもできますが、convex = falseを設定するようにしてください。次に、グループノードは実際には必要ありません。 – McTell

関連する問題