Exemplo n.º 1
0
        private static CSGVertex point(double stack, double slice, int normalblend)
        {
            double    angle  = slice * Math.PI * 2;
            CSGVector _out   = axisX.times((float)Math.Cos(angle)).plus(axisY.times((float)Math.Sin(angle)));
            CSGVector pos    = CylinderBottom.plus(ray.times((float)stack)).plus(_out.times(CylinderRadius));
            CSGVector normal = _out.times(1 - Math.Abs(normalblend)).plus(axisZ.times(normalblend));

            return(new CSGVertex(pos, normal));
        }
Exemplo n.º 2
0
        private static CSGVertex AddVertex(double theta, double phi)
        {
            theta *= Math.PI * 2;
            phi   *= Math.PI;

            CSGVector dir = new CSGVector(
                (float)(Math.Cos(theta) * Math.Sin(phi)),
                (float)Math.Cos(phi),
                (float)(Math.Sin(theta) * Math.Sin(phi)));

            return(new CSGVertex(center.plus(dir.times(SphereRadius)), dir));
        }