x3dom:6.建立坐标系及坐标网格

  1. 实体坐标系(加x,y,z标志)
    在这里插入图片描述

<X3D> 
  <Scene>
    <Transform id="CoordinateAxes">

    <shape>
        <appearance>
        <material diffuseColor='1 1 0.9'></material>
        </appearance>
        <sphere radius='0.1'/>
    </shape>

		<!-- Vertical Y arrow and label -->
		<Group DEF='ArrowGreen'>

		<Transform translation='0 0.5 0'>
			<Shape>
			<!-- radius原来是.025,height原来为1.0 -->
			  <Cylinder DEF='ArrowCylinder' bottom='false' radius='.05' height='1.0 ' top='false'/>
			  <Appearance DEF='Green'>
				<Material diffuseColor='.1 .6 .1' emissiveColor='.05 .2 .05'/>
			  </Appearance>
			</Shape>
			<Transform translation='0 0.5 0'>
			  <Shape>
			  <!-- radius原来是.10,height原来为.1 -->
				<Cone DEF='ArrowCone' bottomRadius='.10' height='.15'/>
				<Appearance USE='Green'/>
			  </Shape>
			</Transform>

			 <Billboard>
                        <Shape isPickable="false" DEF="AXIS_LABEL_Y">
                            <Text string="Y" solid="false">
                                <FontStyle size="0.6"></FontStyle>
                            </Text>
                            <Appearance USE='Green'></Appearance>
                        </Shape>
              </Billboard>

		</Transform>
		</Group>


		<Transform rotation='0 0 1 -1.57079'>
			<!-- Horizontal X arrow and label -->
			<Group DEF='ArrowRed'>
				<Transform translation='0 0.5 0'>
				  <Shape>
					<Cylinder USE='ArrowCylinder'/>
					<Appearance DEF='Red'>
					  <Material diffuseColor='.7 .1 .1' emissiveColor='.33 0 0'/>
					</Appearance>
				  </Shape>
				  <Transform translation='0 0.5 0'>
					<Shape>
					  <Cone USE='ArrowCone'/>
					  <Appearance USE='Red'/>
					</Shape>
				  </Transform>

				  <Billboard>
                        <Shape isPickable="false" DEF="AXIS_LABEL_Y">
                            <Text string="X" solid="false">
                                <FontStyle size="0.6"></FontStyle>
                            </Text>
                            <Appearance USE='Red'></Appearance>
                        </Shape>
                 </Billboard>

				</Transform>
			</Group>
		</Transform>



		<Transform rotation='1 0 0 1.57079'>
			<!-- Perpendicular Z arrow and label, note right-hand rule -->
			<Group DEF='ArrowBlue'>
				<Transform translation='0 0.5 0'>
				  <Shape>
					<Cylinder USE='ArrowCylinder'/>
					<Appearance DEF='Blue'>
					  <Material diffuseColor='.3 .3 1' emissiveColor='.1 .1 .33'/>
					</Appearance>
				  </Shape>
				  <Transform translation='0 0.5 0'>
					<Shape>
					  <Cone USE='ArrowCone'/>
					  <Appearance USE='Blue'/>
					</Shape>
				  </Transform>

				   <Billboard>
                        <Shape isPickable="false" DEF="AXIS_LABEL_Y">
                            <Text string="Z" solid="false">
                                <FontStyle size="0.6"></FontStyle>
                            </Text>
                            <Appearance USE='Blue'></Appearance>
                        </Shape>
                 </Billboard>

				</Transform>
			</Group>
		</Transform>
	
    </Transform>
  </Scene>
</X3D>

2.线坐标系

3.坐标网格
在这里插入图片描述

<X3D>
    <scene>
        <Shape id="plane" isPickable="false">
            <Appearance DEF="GRID_APPEARANCE" sortKey="-1">
                <Material diffuseColor='0.0 0.0 0.0' specularColor='0.0 0.0 0.0' emissiveColor='0.3 0.3 0.3'></Material>
                <DepthMode id="depthMode" readOnly="false"></DepthMode>
            </Appearance>
            <Plane id="gridPlane" solid="false" size='10 10' primType='LINES' subdivision='20 20'>
            </Plane>
        </Shape>
        <Shape id="planeBorder" isPickable="false">
            <Appearance >
                <Material diffuseColor='0.0 0.0 0.0' specularColor='0.0 0.0 0.0'  emissiveColor='0.3 0.3 0.3'></Material>
                <DepthMode  readOnly="false"></DepthMode>
            </Appearance>
            <IndexedLineSet coordIndex="0 1 2 3 0 -1" colorPerVertex="false" lit="false">
                <Coordinate id="gridBordersCoordNode" point="-10.0 -10.0 0.0 , -10.0 10.0 0.0 , 10.0 10.0 0.0, 10.0 -10.0 0.0"/>
            </IndexedLineSet>
        </Shape>
    </scene>
</X3D>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值