Skip to content

Instantly share code, notes, and snippets.

@lachsen
lachsen / index.html
Created November 4, 2013 12:50
Boilerplate code for an XML3D scene in HTML using xml3d.js
<!doctype html>
<html>
<head>
<title>XML3D Boilerplate Code</title>
<!-- Include the xml3d.js library first -->
<script type="text/javascript" src="http://www.xml3d.org/xml3d/script/xml3d.js"></script>
<!-- Other <script> tags -->
</head>
<body>
<!--
window.KeySpline = function(mX1, mY1, mX2, mY2) {
this.get = function(aX) {
if (mX1 == mY1 && mX2 == mY2) return aX; // linear
return CalcBezier(GetTForX(aX), mY1, mY2);
};
function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
function C(aA1) { return 3.0 * aA1; }