首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IndexedFaceSet在x3d文件中创建额外的面

IndexedFaceSet在x3d文件中创建额外的面
EN

Stack Overflow用户
提问于 2016-04-22 17:24:53
回答 1查看 86关注 0票数 0

我已经使用x3dom创建了一个x3d文件。以下是该文件的结构。将以下代码复制到文本编辑器中,并将其另存为.x3d文件。对于图像纹理,您可以考虑任何jpg文件,并将其放置在与x3d相同的位置。

代码语言:javascript
复制
<?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 profile='Interchange' version='3.0'    
xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' 
xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.0.xsd'>
<Scene>
   <NavigationInfo type='"EXAMINE" "WALK" "FLY" "ANY"'/>
   <DirectionalLight intensity="0.8" direction="0 1 0"/>
   <DirectionalLight intensity="0.9" direction="0 -1 0"/>
   <DirectionalLight intensity="0.6" direction="1 0 -1"/>
   <DirectionalLight intensity="0.6" direction="-1 0 -1"/>
   <DirectionalLight intensity="0.6" direction="-1 0 1"/>
   <DirectionalLight intensity="0.6" direction="1 0 1"/>
   <Shape>
      <Appearance>
         <Material ambientIntensity="0.2" diffuseColor="0.004 0.004 0.004" emissiveColor="0 0 0" shininess="0.2" specularColor="0 0 0" transparency="0"/>
         <ImageTexture url="Penguins.jpg"/>
      </Appearance>
   <IndexedFaceSet convex="true" coordIndex="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 -1 " ccw="true">
       <Coordinate point="132.2349 0 329.9732 123.0347 0 336.9273 109.9391 0 350.0229 102.985 0 359.223 82.26761 0 386.6317 69.30841 0 436.438 74.03987 0 470.4683 78.77134 0 504.4987 104.8261 0 548.8805 132.2349 0 569.598 191.8598 0 569.598 191.8598 0 689.9727 911.8589 0 689.9727 1032.234 0 569.598 1032.234 0 270.3483 852.2339 0 270.3483 852.2339 0 210.7232 371.8596 0 210.7232 371.8596 0 329.9732"/>
   </IndexedFaceSet>
  </Shape>
  <Viewpoint description="Center of Space" fieldOfView="0.785" position="553.1368 60 450.348"/>
 </Scene>
</X3D>

从俯视图看,3D对象看起来像这样,enter image description here

从底部视图看,它看起来像这样,enter image description here

我已经检查了所有的点,它们是按正确的顺序排列的,但不确定为什么要创建这两个额外的面。我有什么地方做错了吗?

EN

回答 1

Stack Overflow用户

发布于 2016-09-30 22:35:38

你画了一个非凸的形状,因此你需要将凸起设置为false,另外,如果你想从“后面”看到你的形状,你需要将solid设置为false。

这是可行的:

代码语言:javascript
复制
<IndexedFaceSet convex="false" solid="false" coordIndex="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 -1">

(您不需要ccw,默认情况下为true )

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36789955

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档