Hello i am trying to make cms with threejs, and i want to add the json attributes to a mesh of threejs. I can retrieve the json attributes separate with:
console.log(Articles.results[i].id);
but i want for example to have mesh.id etc.
my json output is:
{id: 6, title: "ytc zjzx", summary: "zxv xzcv xcvzx", content: "zxvxcbvcx bcvbdf", publicationDate: 1506632400}
length
:
2
__proto__
:
Array(0)
totalRows
:
2
__proto__
:
Object
And my code until now:
function addGeometry() {
var geometry = new THREE.BoxBufferGeometry(25, 25, 25);
var material = new THREE.MeshBasicMaterial({color:0x00ff44});
for(var i = 0; i < Articles.results.length; i += 1){
console.log(Articles);
mesh = new THREE.Mesh( geometry, material );
mesh.position.y =Math.random() * ((HEIGHT-10) - (HEIGHT+10));
mesh.position.x =Math.random() * ((HEIGHT-10) - (HEIGHT+10));
mesh.updateMatrix();
mesh.matrixAutoUpdate = false;
scene.add( mesh );
}