Last active
September 27, 2015 15:28
-
-
Save ZJONSSON/1291672 to your computer and use it in GitHub Desktop.
Simple X3D with D3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="https://raw.github.com/mbostock/d3/v2.4.3/d3.js"></script> | |
<script type="text/javascript" src="http://x3dom.org/x3dom/example/x3dom.js"></script> | |
</head> | |
<body> | |
</body> | |
<script type="text/javascript"> | |
d3.ns.prefix.x3da="http://www.web3d.org/specifications/x3d-namespace" | |
x3d = d3.select("body") | |
.append("x3d:x3d") | |
.attr("height","500px") | |
.attr("width","100%"); | |
scene = x3d.append("x3d:scene") | |
box= scene.append("x3d:shape") | |
.append("x3d:box") | |
</SCRIPT> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Agree completely. The purpose of this example and http://bl.ocks.org/1291667 was simply to demonstrate how D3 and X3DOM complement each other perfectly, without adding too much detail in the code.
PS: An alternative to mousewheel-zoom is holding right button and moving the mouse.
More detail here: http://x3dom.org/docs/latest/navigation.html