Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function add_face_x(mesh, x, face){
- const ndx = mesh.vertices.length / 3;
- var [start_greedy, width, start_increment, height] = face;
- mesh.vertices.push(
- x, start_greedy, start_increment,
- x, start_greedy + width + 1, start_increment,
- x, start_greedy , start_increment + height + 1,
- x, start_greedy + width + 1, start_increment + height + 1);
- mesh.normals.push(-1,0,0);
- mesh.uvs.push(x*16*16+start_greedy,start_increment);
- mesh.uvs.push(x*16*16+start_greedy+width+1, start_increment);
- mesh.uvs.push(x*16*16+start_greedy,start_increment + height+1);
- mesh.uvs.push(x*16*16+start_greedy+width+1,start_increment + height+1);
- mesh.indices.push(
- ndx, ndx + 1, ndx + 2,
- ndx + 2, ndx + 1, ndx + 3,
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment