Exemplo n.º 1
0
        public static FrustumPlane createByPointOnPlaneAndNormal(SpatialVectorDouble position, SpatialVectorDouble normal)
        {
            FrustumPlane resultPlane = new FrustumPlane();

            resultPlane.normal   = normal.deepClone();
            resultPlane.distance = -SpatialVectorDouble.dot(normal, position);
            return(resultPlane);
        }
Exemplo n.º 2
0
        public void renderString(string @string, SpatialVectorDouble signScale, SpatialVectorDouble position)
        {
            Debug.Assert(lineRendererDriver != null);

            SpatialVectorDouble currentPosition = position.deepClone();



            // TODO< find optimal scale >
            const float rescalingFactor = 1.0f / 16.0f;

            lineRendererDriver.scale = signScale.scale(rescalingFactor); // normalize scale with scale of a typical sign

            int i = 0;

            foreach (char @char in @string)
            {
                lineRendererDriver.center = currentPosition;

                // continue with next sign if we can't look it up
                if (!signToHersheyCommandIndex.ContainsKey(@char))
                {
                    continue;
                }

                int    commandIndex    = signToHersheyCommandIndex[@char];// (60+30-1) + 3*30; // signToHersheyCommandIndex[@char];
                string hersheyCommands = hersheyCommandsOfLetters[commandIndex];

                hesheyInterpreter.interpret(hersheyCommands, lineRendererDriver);

                float widthBeforeRescaling = lineRendererDriver.positionRight - lineRendererDriver.positionLeft; // width is the difference
                float width = (widthBeforeRescaling * rescalingFactor) * (float)signScale.x;

                currentPosition.x += width;

                i++;// for testing
            }
        }