Esempio n. 1
0
        public override bool visitLeaf(CS_Leaf leaf)
        {
            DX_Transformation transf = leaf.getTransformation();

            List <DXMEV> mev = new List <DXMEV>();

            foreach (DXMEV m in V)
            {
                DXMEV mp = new DXMEV();
                mp.P = transf.apply(m.P);
                mp.P = new Vector4(mp.P.X, mp.P.Z, mp.P.Y, 1);
                mev.Add(mp);

                BBox.Maximum = Vector3.Max(BBox.Maximum, new Vector3(mp.P.X, mp.P.Y, mp.P.Z));
                BBox.Minimum = Vector3.Min(BBox.Minimum, new Vector3(mp.P.X, mp.P.Y, mp.P.Z));
            }

            int c = Vertices2[LEAFLEVEL].Count;

            foreach (int k in I)
            {
                Indices2[LEAFLEVEL].Add(c + k);
            }

            Vertices2[LEAFLEVEL].AddRange(mev);

            return(true);
        }
Esempio n. 2
0
            public override bool visitLeaf(CS_Leaf leaf)
            {
                DX_Transformation transf = leaf.getTransformation();

                _lmh.AddLeaf(transf);

                return(true);
            }
Esempio n. 3
0
        public override bool visitLeaf(CS_Leaf leaf)
        {
            DXSKV             v0, v1;
            DX_Transformation transf = leaf.getTransformation();


            // the tree is caculated in openGL coordinates with Z "up" so...
            v0.P = new Vector3(0, 0, 0);
            v1.P = new Vector3(0, 0, _csParams.LeafScale);
            v0.P = transf.apply(v0.P); v0.P = new Vector3(v0.P.X, v0.P.Z, v0.P.Y);
            v1.P = transf.apply(v1.P); v1.P = new Vector3(v1.P.X, v1.P.Z, v1.P.Y);
            v0.C = colors[5];
            v1.C = colors[5];

            BBox.Maximum = Vector3.Max(BBox.Maximum, v0.P);
            BBox.Maximum = Vector3.Max(BBox.Maximum, v1.P);
            BBox.Minimum = Vector3.Min(BBox.Minimum, v0.P);
            BBox.Minimum = Vector3.Min(BBox.Minimum, v1.P);

            Vertices2[LEAFLEVEL].Add(v0);
            Vertices2[LEAFLEVEL].Add(v1);

            return(true);
        }