其实就是在上面贴图就好了。(为每一个面贴图)
效果图:
<!DOCTYPE html >
<html >
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Hello World</title>
<link rel="stylesheet" type="text/css" href="x3dom.css" />
</head>
<body>
<h1>Non PowerOfTwo Texture</h1>
<p>
<a href='http://www.khronos.org/registry/gles/specs/2.0/es_cm_spec_2.0.24.pdf'>OpenGL ES 2.0</a> supports non-power of two 2D textures, with the caveat that mip- mapping and texture wrap modes other than clamp to edge are not supported.
</p>
<h2>With standard repeatS/repeatT set to true; should not work on OpenGL-ES 2.0</h2>
<div>
<x3d showStat="false" showLog="false" x="0px" y="0px" width="400px" height="300px" altImg="helloX3D-alt.png">
<scene>
<viewpoint position='0 0 5' ></viewpoint>
<shape>
<appearance>
<imageTexture repeatS='true' repeatT='true' url='texture/basic/nonPO2Texture.png'></imageTexture>
</appearance>
<box DEF='box' ></box>
</shape>
</scene>
</x3d>
</div>
<h2>With standard repeatS/repeatT set to false; should work on OpenGL-ES 2.0</h2>
<div>
<x3d showStat="false" showLog="false" x="0px" y="0px" width="400px" height="300px" altImg="helloX3D-alt.png">
<scene>
<viewpoint position='0 0 5' ></viewpoint>
<shape>
<appearance>
<imageTexture repeatS='false' repeatT='false' url='texture/basic/nonPO2Texture.png'></imageTexture>
</appearance>
<box DEF='box' ></box>
</shape>
</scene>
</x3d>
</div>
<script type="text/javascript" src="x3dom.js"></script>
</body>
</html>