OLD | NEW |
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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 <p> | 320 <p> |
321 Press Animate to animate the camera and use the textboxes to manually | 321 Press Animate to animate the camera and use the textboxes to manually |
322 set the position of the camera. | 322 set the position of the camera. |
323 </p> | 323 </p> |
324 <!-- Centre everything in the div --> | 324 <!-- Centre everything in the div --> |
325 <table id="container" width="98%" style="height:50%;"><tr><td height="100%"> | 325 <table id="container" width="98%" style="height:50%;"><tr><td height="100%"> |
326 <!-- Start of g_o3d plugin --> | 326 <!-- Start of g_o3d plugin --> |
327 <div id="o3d" style="width: 100%; height: 100%;"></div> | 327 <div id="o3d" style="width: 100%; height: 100%;"></div> |
328 <!-- End of g_o3d plugin --> | 328 <!-- End of g_o3d plugin --> |
329 </td></tr></table> | 329 </td></tr></table> |
330 | 330 |
331 <!-- Don't render the textarea --> | 331 <!-- Don't render the textarea --> |
332 <div style="display:none"> | 332 <div style="display:none"> |
333 <!-- Start of effect --> | 333 <!-- Start of effect --> |
334 <textarea id="vshader"> | 334 <textarea id="vshader"> |
335 // World View Projection matrix that will transform the input vertices | 335 // World View Projection matrix that will transform the input vertices |
336 // to screen space. | 336 // to screen space. |
337 uniform mat4 worldViewProjection; | 337 uniform mat4 worldViewProjection; |
338 » | 338 |
339 // input parameters for our vertex shader | 339 // input parameters for our vertex shader |
340 attribute vec4 position; | 340 attribute vec4 position; |
341 attribute vec4 color; | 341 attribute vec4 color; |
342 » | 342 |
343 // passing color to the fragment shader | 343 // passing color to the fragment shader |
344 varying vec4 fragmentColor; | 344 varying vec4 fragmentColor; |
345 » | 345 |
346 /** | 346 /** |
347 * The vertex shader simply transforms the input vertices to screen sp
ace. | 347 * The vertex shader simply transforms the input vertices to screen sp
ace. |
348 */ | 348 */ |
349 void main() { | 349 void main() { |
350 // Multiply the vertex positions by the worldViewProjection matrix t
o | 350 // Multiply the vertex positions by the worldViewProjection matrix t
o |
351 // transform them to screen space. | 351 // transform them to screen space. |
352 gl_Position = worldViewProjection * position; | 352 gl_Position = worldViewProjection * position; |
353 fragmentColor = color; | 353 fragmentColor = color; |
354 } | 354 } |
355 </textarea> | 355 </textarea> |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 onClick="toggleAnimate()"/> | 447 onClick="toggleAnimate()"/> |
448 </td> | 448 </td> |
449 </tr> | 449 </tr> |
450 </tbody> | 450 </tbody> |
451 </table> | 451 </table> |
452 </form> | 452 </form> |
453 </td></tr></table> | 453 </td></tr></table> |
454 </td></tr></table> | 454 </td></tr></table> |
455 </body> | 455 </body> |
456 </html> | 456 </html> |
OLD | NEW |