var cubeVertices = [
Vector3(0, 0, 0),
Vector3(10, 0, 0),
Vector3(0, 10, 0),
Vector3(10, 10, 0),
Vector3(0, 0, 10),
Vector3(10, 0, 10),
Vector3(0, 10, 10),
Vector3(10, 10, 10)
];
var cubeTriangles = [
0, 1, 2,
0, 2, 3,
1, 0, 4,
1, 5, 4,
1, 5, 3,
7, 5, 3,
7, 2, 3,
7, 6, 2,
4, 6, 2,
4, 0, 2,
4, 5, 7,
4, 6, 7
];
function Start () {
var mesh = new Mesh ();
GetComponent (MeshFilter).mesh = mesh;
mesh.vertices = cubeVertices;
// mesh.uv = cubeUV;
mesh.triangles = cubeTriangles;
}
ok, now tell me what I’m doin’ wrong. :roll:
(More information?)
Okay, so, I’m looking at the API docs on the Mesh class. Some parts are pretty decent, and others a little on the sparse side. I think my problem might have to do with normals (what 3D problem doesn’t?), but I’m not sure how to set those up. It says it’s a Vector3, but then it wants me to use a quaternion? I’m like, wtf are these, anyway? They’re supposed to point… outwards. That’s all I know. :I
Oh, and I got all those numbers by takin’ out a notebook drawin’ a cube and putting 3D coordinates to it, then, well, following the directions I saw in the API docs… Just on treemeat.