Skip to content

Instantly share code, notes, and snippets.

@humbletim
Last active April 22, 2023 09:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save humbletim/f5428fefb1d0985292094d7fc1d5807b to your computer and use it in GitHub Desktop.
Save humbletim/f5428fefb1d0985292094d7fc1d5807b to your computer and use it in GitHub Desktop.
glm-js source test page
<!-- for gist purposes this BASE HREF makes everything load relative to the current live web examples -->
<!-- note: save this file in a subfolder off the the project root and remove the BASE HREF to experimental locally -->
<base href='https://humbletim.github.io/glm-js/code/test/index.html' />
<!-- glm-js core scripts -->
<script src="../src/glm.common.js" type="text/javascript"></script>
<script src="../src/glm.buffers.js" type="text/javascript"></script>
<script src="../src/glm.experimental.js" type="text/javascript"></script>
<!-- specific vendor back-end (variations exist for tdl-fast and gl-matrix as well) -->
<script src="../lib/three.js" type="text/javascript"></script>
<script src="../src/glm.three.js" type="text/javascript"></script>
<!-- ... quick inline example of printing out some lookAt values -->
<pre id="output"></pre>
<script>
var q = glm.lookAt(
glm.vec3(20, 80, 15),
glm.vec3(15, 0, 12),
glm.vec3(0, -1, 0)
);
output.innerText += [
'glm: ' + glm.version,
'glm.lookAt(...): ' + q,
'glm.toMat4(glm.lookAt(...)): ' + glm.toMat4(q),
].join('\n');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment