some things to research-
Combine children extended version
export object script
the planar uv script-
if you have objects divided into planar surfaces, you can calculate the UVs for each plane individually with that.
I just put an extra name/tag on some of my tiles to say if they pointed North South East West up down, and used 6 cases of the above formula to UV them perfectly.
also there is a script that automatically makes texture Atlas somewhere on this forum.
Normally, if you textured your model before combining it/deleting triangles that are duplicates, well the texture information would still be there when you combine it and when you create rectangles.
feel free to post any code for merging squares into rectangles, it would be useful for me also! I’d love to see it!
Edit--------------
I can’t believe it I commented in length and then I got a call, and I pressed post your answer and disappeared everything.
Texture Atlas doesn’t make mistakes, you specify the part of the texture instead of the file name. when the code allows for the atlas it’s fine.
Check this awesome page, it has Kubik projection which is what I had in mind a vaguely for my project and also for cubes it should be very good. I can probably paste the code afterwards because I’m probably doing it today. modo 501 Inline Help System
the other way to do it is convert the normals to UVs using the render function from Unifi wiki mc blob marching cubes code.
I divided the function into 2, to render the vertices and triangles, And the UVs afterwards:
/*Unity and Sample Specific*/
private void renderMesh()
{
int i;
/*Clear the Vertices that don't have any real information assigned to them */
for(i=0;i<vertP;i++) {fv<em>=newVertex<em>;fn_=newNormal*;*_</em></em>
}
for(i=0;i<triP;i++) {ft_=newTri*;}_
_for(i=triP;i<ft.Length;i++) {ft=0;}
Mesh mesh=((MeshFilter) GetComponent(“MeshFilter”)).mesh;
mesh.vertices = fv ;
mesh.uv = fuv;
mesh.triangles = ft;
mesh.normals = fn;
/For Disco Ball Effect/
mesh.RecalculateNormals();
}
private void nls()
{
int i;
Mesh mesh=((MeshFilter) GetComponent(“MeshFilter”)).mesh;
fn = mesh.normals;
/Clear the Vertices that don’t have any real information assigned to them /
for(i=0;i<vertP;i++) {_
_fuv=tada2[tadac2++];_
_Vector3 fuvt=transform.TransformPoint(fn).normalized;_
//fuv.x=(fuvt.x+1f).5f;fuv_.y=(fuvt.y+1f).5f;}
fuv.x=fn.x;fuv.y=fn.y;}
for(i=vertP;i<fv.Length;i++) {fv[0]=0;fn[0]=0;fuv[0]=0;
fv[1]=0;fn[1]=0;fuv[1]=0;_
_fv[2]=0;}
//Mesh mesh=((MeshFilter) GetComponent(“MeshFilter”)).mesh;
mesh.uv = fuv;
gameObject.AddComponent(“MeshCollider”);
/For Disco Ball Effect/
//mesh.RecalculateNormals();
}*_