Page Mesh


Create meshes to be used for pages. This is basically a box with user defined dimensions and the number of segments in each direction and controls for where the pivot is.

Page Mesh Param Description

Width

Width of the mesh.

Length

Length of the mesh.

Height

Height of the mesh.

Width Segs

Number of vertices for the width of the mesh.

Length Segs

Number of vertices for the Length of the mesh.

Height Segs

Number of vertices for the height of the mesh.

Gen UVs

Generate UV coordinates, needed if you want to apply a texture to the mesh.

Rotate

Rotate the UV coordinates about the vertical axis.

Pivot Base

Move the pivot to the bottom of the mesh.

Pivot Edge

Move the pivot to the edge of the mesh, needed for easy page flipping.

Tangents

If you plan on using shaders that require tangents on the mesh ie bump mapping turn this on.

Optimize

Get unity to optimize the mesh.

Page Mesh Class

public class MegaMeshPage : MonoBehaviour
{
    public float    Width;
    public float    Length;
    public float    Height;
    public int      WidthSegs;
    public int      LengthSegs;
    public int      HeightSegs;
    public bool     genUVs;
    public float    rotate;
    public bool     PivotBase;
    public bool     PivotEdge;
    public bool     tangents;
    public bool     optimize;
}

5 Comments

  • tomihr

    1

    Hello, is there a way to add different material to the page mesh sides so could have a different material for every site of the page mesh, 6 materials in exact. Thanks

    • spookycat

      2

      Not as it stands at the moment, it is only a helper you can always use Max, Blender or Maya etc to build the mesh you want with the required materials, It would not take long to update the script to use 6 materials, I may add that option in the next update.

      • twistor

        3

        Hi - this gets my vote too. This would be very useful for dynamically placing lines of preset text (stored as textures) on a page at runtime, for example. The texture boundaries of a custom page mesh defining the regions of text would be defined externally in a 3d package. Since adding the Page Flip script directly to such a custom mesh doesn't work out of the box, I have tried naively changing the MegaPageMesh code to use an alternative mesh asset imported (as an FBX) from a 3D package, together with its materials, but it appears the MegaFiers code just rebuilds the default page mesh from scratch whenever the Page Mesh params are altered in the Editor, immediately replacing the custom mesh. Any chance you could post up how to do this, or even better tell us when such an option might be coming?! Thanks

        • spookycat

          4

          Little confused :) If you made a page mesh in a 3d package then you don't need the Page Mesh system just import your page mesh into Unity, add it to the scene and apply the Page Flip modifier to it, the Page Mesh was added just as an easy way to make page meshes with adjustable vertex counts. Am I missing something?

          • twistor

            5

            Thanks for the reply. Well that's what I was hoping would happen ;-)...ie just import my (simple 10x10x1 box with 12 materials) mesh into Unity (3.5.6), apply the Page Flip modifier (MegaFiers v2.24), and bingo. However, when I add the modifier to the instantiated object in the scene view, the original mesh just disappears, and the MeshFilter slot, which contained my original imported mesh "Page", is replaced by "Page Instance", and now appears to be an empty mesh. If I manually replace this in the Inspector with my original "Page" mesh from my Assets, the correct mesh re-appears in the scene, but none of the Page Flip modifer parameters (eg "turn") have any effect on it. I can see the gizmo outline bending, but the mesh is unaffected. Whereas if I use the MegaFiers Page Mesh helper and then apply the Page Flip, it flips perfectly, but then I only have front, back and side materials...

You must be logged in to post a comment.