コード例 #1
0
    void step0()
    {
                #if UNITY_EDITOR
        //Debug.Log("in step 0");
//		for(int i = 0; i < meshX.vertices.Length; i++)
//		{
//			Debug.Log(meshX.vertices[i] +":vertex");
//		}
//		Debug.Log("end of vertices");
//		for(int i =0; i<meshX.triangles.Length; i++)
//		{
//			Debug.Log(meshX.triangles[i] + ":triangle");
//		}
//		Debug.Log("end of triangles");
//		for(int i=0;i <meshX.uv.Length; i++)
//		{
//			Debug.Log(meshX.uv[i] + ":uv");
//		}
//		Debug.Log("end uv");
                #endif
//#if UNITY_EDITOR
//		Debug.Log("step 0");
//#endif

        meshX.Tesselate();
        meshX.Tesselate();
        meshX.Tesselate();
        meshX.RecalaculateNormals();
        //meshX.DeformByNormal(0.0f, 2.0f);
        meshX.DeformByNormal();
        meshX.RecalaculateNormals();
        //meshX.Tesselate();
        //meshX.DeformByNormal(-1.0f, 0.0f);
        meshX.DeformByNormal();
        //meshX.clearTexToBlack();
        meshX.setPixels(() => { return(new Color(
                                           (float)meshX.currentDistribution.NextDouble(),
                                           (float)meshX.currentDistribution.NextDouble(),
                                           //0,0,
                                           meshX.currentGenerator.NextBoolean()? 0.75f: 0.25f
                                           //(float)meshX.currentDistribution.NextDouble()
                                           )); });
        //meshX.uvToSphericalCoords();
        //meshX.uvTofourCubesCoords();
        //meshX.uvToNbuCoords();
        meshX.xyzLT1();
        meshX.CommitToMasterFinishedOnMain += step1;
        meshX.CommitToMaster();
    }
コード例 #2
0
    void step0()
    {
                #if UNITY_EDITOR
        //Debug.Log("in step 0");
        //		for(int i = 0; i < meshX.vertices.Length; i++)
        //		{
        //			Debug.Log(meshX.vertices[i] +":vertex");
        //		}
        //		Debug.Log("end of vertices");
        //		for(int i =0; i<meshX.triangles.Length; i++)
        //		{
        //			Debug.Log(meshX.triangles[i] + ":triangle");
        //		}
        //		Debug.Log("end of triangles");
        //		for(int i=0;i <meshX.uv.Length; i++)
        //		{
        //			Debug.Log(meshX.uv[i] + ":uv");
        //		}
        //		Debug.Log("end uv");
                #endif
        //#if UNITY_EDITOR
        //		Debug.Log("step 0");
        //#endif
        meshX.RecalaculateNormals();
        //meshX.Tesselate();
        //meshX.Tesselate();
        //meshX.ConvexTesselationBridging(0.1f);
        //meshX.ConvexTesselationBridging(0.05f);
        meshX.TesselateWithModifiedNormals(() => { return(1.1f); });
        meshX.DeformByNormal(() => { return(0.1f); });
//		meshX.Tesselate();
        //meshX.RecalaculateNormals();
        //meshX.DeformByNormal();
        meshX.DeformByNormal(() => { return(0.5f * (float)meshX.currentDistribution.NextDouble()); });
        meshX.setDistribution(MeshXT2.distributions.Laplace, new Dictionary <string, double>()
        {
            { "alpha", alpha }, { "mu", mu }
        });
        meshX.RecalaculateNormals();
        //meshX.Tesselate();
        meshX.CommitToMasterFinishedOnMain += step1;
        meshX.CommitToMaster();
    }