Mercurial > hg > Members > e085737 > sample
view map/map.html @ 20:d322eed6e1c7
add
author | <e085737> |
---|---|
date | Thu, 13 Jan 2011 21:37:23 +0900 |
parents | |
children |
line wrap: on
line source
<html> <head> <title>Earth and Mars</title> <script src="resources/render/SceneGraphRoot.js" type="text/javascript"></script> <script src="resources/render/SceneGraph.js" type="text/javascript"></script> <script src="resources/render/jkl-parsexml.js" type="text/javascript"></script> <script src="resources/render/Image_xml.js" type="text/javascript"></script> <script src="resources/render/keybord.js" type="text/javascript"></script> <script src="resources/render/DrawObject.js" type="text/javascript"></script> <!-- <script src="resources/render/J3DI.js" type="text/javascript"> </script> <script src="resources/render/J3DIMath.js" type="text/javascript"> </script> --> <script src="J3DI.js"> </script> <script src="J3DIMath.js"> </script> <!--<script src="resources/render/webgl-utils.js" type="text/javascript"></script> --> <script type="text/javascript" src="webgl-utils.js"></script> <script src="resources/render/init.js" type="text/javascript"> </script> <script src="resources/render/camera.js" type="text/javascript"> </script> <script src="resources/walk.js" type="text/javascript"></script> <script src="resources/bullet.js" type="text/javascript"></script> <script src="resources/pants.js" type="text/javascript"></script> <script src="resources/human.js" type="text/javascript"></script> <script src="resources/combat_plane.js" type="text/javascript"></script> <script id="vshader" type="x-shader/x-vertex"> uniform mat4 u_modelViewProjMatrix; uniform mat4 u_normalMatrix; uniform vec3 lightDir; attribute vec3 vNormal; attribute vec4 vTexCoord; attribute vec4 vPosition; varying float v_Dot; varying vec2 v_texCoord; void main() { gl_Position = u_modelViewProjMatrix * vPosition; v_texCoord = vTexCoord.st; vec4 transNormal = (u_normalMatrix) * vec4(vNormal,1); v_Dot = max(min(dot(transNormal.xyz, lightDir),1.0), 0.8); } </script> <script id="fshader" type="x-shader/x-fragment"> #ifdef GL_ES precision mediump float; #endif uniform sampler2D sampler2d; varying float v_Dot; varying vec2 v_texCoord; void main() { vec4 color = texture2D(sampler2d,v_texCoord); /* 光源の色を設定 */ color += vec4(0.1,0.1,0.1,1); gl_FragColor = vec4(color.xyz * v_Dot, color.a); } </script> <style type="text/css"> canvas { border: 2px solid black; } </style> </head> <body onload="start()"> <canvas id="screen"></canvas> <div id="framerate"></div> <div id="console"></div> </body> </html>