Built with blockbuilder.org
Last active
May 16, 2018 09:47
-
-
Save mforando/53d8e59d0db4cb03bd8d25e6c8393067 to your computer and use it in GitHub Desktop.
First A-Frame Example
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
license: mit |
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> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script src="https://aframe.io/releases/0.8.0/aframe.min.js"></script> | |
<style> | |
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } | |
</style> | |
</head> | |
<body> | |
<a-scene id="myscene"> | |
</a-scene> | |
<script> | |
var data = [] | |
for (var i = 0; i < 50; i++) { | |
data.push({x:Math.random()*100,y:Math.random()*100,z:Math.random()*100}) | |
} | |
console.log(data) | |
d3.select("#myscene") | |
.selectAll("a-sphere") | |
.data(data).enter() | |
.append("a-sphere") | |
.attr("position",function(d){ | |
return d.x + " " + d.y + " " + (-d.z) | |
//return d | |
}) | |
.attr("color","#EF2D5E") | |
.attr("radius",1.5) | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment