Hi All,
I am trying to do texturing map on a cube. I have read the sceneJS
wiki about texture mapping.
http://scenejs.wikispaces.com/texture
However, right now I have a black cube with no texture mapping. The
following is my code.
{
"type": "geometry",
"coreId": "1g11z8oXL0HfHgCCmSivZT",
"primitive": "triangles",
"positions": [
1, 1, 1, -1, 1, 1,-1,-1, 1, 1,-1, 1,
1, 1, 1, 1,-1, 1, 1,-1,-1,1, 1,-1,
1, 1, 1, 1, 1,-1, -1, 1,-1, -1, 1, 1,
-1, 1, 1, -1, 1,-1, -1,-1,-1, -1,-1, 1,
-1,-1,-1, 1,-1,-1, 1,-1, 1, -1,-1, 1,
1,-1,-1, -1,-1,-1,-1, 1,-1, 1, 1,-1
],
"normals": [
0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1,
-1, 0, 0,-1, 0, 0, -1, 0, 0, -1, 0, 0,
0,-1, 0, 0,-1, 0, 0,-1, 0, 0,-1, 0,
1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0,
0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0,
0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1
],
"uv" : [
1, 1, 0, 1, 0, 0, 1, 0,
0, 1, 0, 0, 1, 0, 1, 1,
1, 0, 1, 1, 0, 1, 0, 0,
1, 1, 0, 1, 0, 0, 1, 0,
0, 0, 1, 0, 1, 1, 0, 1,
0, 0, 1, 0, 1, 1, 0, 1
],
"indices": [
0, 1, 2,
0, 2, 3,
4, 5, 6,
4, 6, 7,
8, 9, 10,
8, 10,11,
12,13,14,
12,14,15,
16,17,18,
16,18,19,
20,21,22,
20,22,23
],
"nodes": [
{
"type": "texture",
"layers": [
{
"uri": "
http://d2el4marpcphqf.cloudfront.net/37725.jpg"
}
]
}
]
}
Would someone please help me? Thanks a lot!!
Muqing