devNotes 4-12-16 Spherical Mapping – Audio Xurious

    public void Paint_UV()
    {
        Vector3 cPos = uMove.getCursorPostiion();

        ICO_MeshDraft = cosaHedra.getMeshDraft();
        List<int> tL = ICO_MeshDraft.triangles;
        List<Vector3> vL = ICO_MeshDraft.vertices;
        List<Vector2> uvL = ICO_MeshDraft.uv;

        int numVerts = tL.Count;

        Vector3 vToLoc;
        Vector2 uv = new Vector2(0,0);
        Vector3 vC;

        Vector3 vIn;
        Vector3 vUp;
        Vector3 vRight;

        for (int i = 0; i< numVerts-2; i+=3)
        {
            vC = (vL[tL[i]] + vL[tL[i + 1]] + vL[tL[i + 2]]) / 3f;
            
            vToLoc = vC - cPos;
            if (vToLoc.magnitude < 1.414*fRadius_UV)
            {
                for (int k = i; k < i + 3; k++)
                {
                    vUp = Vector3.up;
                    vIn = vL[tL[k]].normalized;
                    vRight = Vector3.Cross(vUp, vIn);

                    vToLoc = vL[tL[k]] - cPos;

                    vToLoc /= fRadius_UV * 2;

                    uvL[tL[k]] = new Vector2(0.5f + Vector3.Dot(vToLoc, vRight), 0.5f + Vector3.Dot(vToLoc, vUp));
                }    
            }
        }
        cosaHedra.writeMesh();
    }

 

project

 

 

 

Stride – triangles – subtly misleading name – should be tvert_idxs

       public void Paint_UV()
    {
        Vector3 cPos = uMove.getCursorPostiion();

        ICO_MeshDraft = cosaHedra.getMeshDraft();
        List<int> tL = ICO_MeshDraft.triangles;
        List<Vector3> vL = ICO_MeshDraft.vertices;
        List<Vector2> uvL = ICO_MeshDraft.uv;

        int numVerts = tL.Count;

        Vector3 vToLoc;
        Vector2 uv = new Vector2(0,0);
        Vector3 vC;

        //uv.x = 0f;
        //uv.y = 0f;

        for (int i = 0; i< numVerts-2; i+=3)
        {
            vC = (vL[tL[i]] + vL[tL[i + 1]] + vL[tL[i + 2]]) / 3f;

            vToLoc = vC - cPos;
            if (vToLoc.magnitude < 2*fRadius_UV)
            {
                uvL[tL[i]] = new Vector2(0, 0); 
                uvL[tL[i+1]] = new Vector2(0, 0);
                uvL[tL[i+2]] = new Vector2(0, 0);
            }
        }
        cosaHedra.writeMesh();
    }

 

dhgndhnhd

khjkhkll-4

fsdgdfsg

gbgdfgb1

 

 

Overlay_Hex

 

Hexagon

 

Htile

Music From:

dgbdfgbdfgfgsdfg

 

Camp of the Saints
CampOfTheSaints

Crow-Falls
Crow-Falls

Decent of Sweden
Descent-Of-Sweden

With Open Gates Intro
WithOpenGatesIntro

With Open Gates
WithOpenGates

Winter Chan
Winter-Chan

What it Has to Be Instrumental
What-It-Has-To-Be