コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="xmlNode"></param>
        /// <returns></returns>
        private ColorRGB ParseColorRGBNode(XmlNode xmlNode)
        {
            var color = new Athena.Core.DataTypes.ColorRGB {
                R = 1f, G = 1f, B = 1f
            };

            if (xmlNode != null)
            {
                color.R = float.Parse(xmlNode.Attributes["r"].Value);
                color.G = float.Parse(xmlNode.Attributes["g"].Value);
                color.B = float.Parse(xmlNode.Attributes["b"].Value);
            }

            return(color);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="origin"></param>
        /// <param name="direction"></param>
        public void Prepare(Vector3 origin, Vector3 direction)
        {
            Origin    = origin;
            Direction = direction;

            InvDirection.X = 1f / Direction.X;
            InvDirection.Y = 1f / Direction.Y;
            InvDirection.Z = 1f / Direction.Z;

            Sign.X = InvDirection.X < 0 ? 1 : 0;
            Sign.Y = InvDirection.Y < 0 ? 1 : 0;
            Sign.Z = InvDirection.Z < 0 ? 1 : 0;

            // color based on ray direction
            //Color.R = (Direction.X * .5f + .5f);
            //Color.G = (Direction.Y * .5f + .5f);
            //Color.B = (Direction.Z * .5f + .5f);

            Color = ColorRGB.Black;
        }