Skip to content

Instantly share code, notes, and snippets.

@cjcliffe
Created October 11, 2011 23:30
Show Gist options
  • Save cjcliffe/1279794 to your computer and use it in GitHub Desktop.
Save cjcliffe/1279794 to your computer and use it in GitHub Desktop.
Example of new animation constructor /w .get(xml/json) support
// SceneObject with motion constructor, xml/json/id/url compatible.
var boxObject = new CubicVR.SceneObject({
mesh:boxMesh,
motion: {
position: {
0.0: { x: 0, y: 1 },
1.0: { x: 1 },
2.0: { x: -1, y: 0 },
3.0: { x: -0.5 },
4.0: { x: 0, y: 1 },
},
envelope: {
outBehavior: "repeat"
}
}
});
// SceneObject with motion constructor, xml/json/id/url compatible.
var boxObject = new CubicVR.SceneObject({
mesh:boxMesh,
motion: {
position: {
0.0: { x: 0, y: 1 },
1.0: { x: 1 },
2.0: { x: -1, y: 0 },
3.0: { x: -0.5 },
4.0: { x: 0, y: 1 },
},
rotation: {
0.0: { x: 0, z: 0 },
1.0: { x: 90, z: 45 },
envelope: {
outBehavior: "offset"
}
},
envelope: {
outBehavior: "repeat"
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment