Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2527)

Side by Side Diff: samples/o3d-webgl-samples/texturesamplers.html

Issue 2456004: Adding zoom on scrollwheel event to Pool demo. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/o3d-webgl-samples/pool.html ('k') | samples/o3d-webgl/client.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 Copyright 2009, Google Inc. 2 Copyright 2009, Google Inc.
3 All rights reserved. 3 All rights reserved.
4 4
5 Redistribution and use in source and binary forms, with or without 5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are 6 modification, are permitted provided that the following conditions are
7 met: 7 met:
8 8
9 * Redistributions of source code must retain the above copyright 9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer. 10 notice, this list of conditions and the following disclaimer.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 var g_pack; 67 var g_pack;
68 var g_viewInfo; 68 var g_viewInfo;
69 var g_eye; 69 var g_eye;
70 var g_target; 70 var g_target;
71 var g_up; 71 var g_up;
72 var g_finished = false; // for selenium testing 72 var g_finished = false; // for selenium testing
73 73
74 function scrollMe(e) { 74 function scrollMe(e) {
75 g_eye = g_math.mulScalarVector((e.deltaY < 0 ? 11 : 13) / 12, g_eye); 75 g_eye = g_math.mulScalarVector((e.deltaY < 0 ? 11 : 13) / 12, g_eye);
76 g_viewInfo.drawContext.view = g_math.matrix4.lookAt(g_eye, g_target, g_up); 76 g_viewInfo.drawContext.view = g_math.matrix4.lookAt(g_eye, g_target, g_up);
77 // Prevents event from reaching up to the window, e.g. so page will not scroll
78 o3djs.event.cancel(e);
79 } 77 }
80 78
81 /** 79 /**
82 * Creates the client area. 80 * Creates the client area.
83 */ 81 */
84 function init() { 82 function init() {
85 o3djs.webgl.makeClients(initStep2); 83 o3djs.webgl.makeClients(initStep2);
86 } 84 }
87 85
88 /** 86 /**
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 263
266 /* Given the texture coordinates, our pixel shader grabs the corresponding 264 /* Given the texture coordinates, our pixel shader grabs the corresponding
267 * color from the texture. 265 * color from the texture.
268 */ 266 */
269 void main() { 267 void main() {
270 gl_FragColor = texture2D(texSampler, texCoord); 268 gl_FragColor = texture2D(texSampler, texCoord);
271 } 269 }
272 </textarea> 270 </textarea>
273 </body> 271 </body>
274 </html> 272 </html>
OLDNEW
« no previous file with comments | « samples/o3d-webgl-samples/pool.html ('k') | samples/o3d-webgl/client.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698