public TexturedDisk(double radiusInner, double radiusOuter, Bitmap texture)
     : base(radiusInner, radiusOuter)
 {
     textureMap    = new DiscMapping(radiusInner, radiusOuter, texture.Width, texture.Height);
     textureWidth  = texture.Width;
     textureBitmap = Util.getNativeTextureBitmap(texture);
 }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="equation"></param>
        /// <param name="sizex"></param>
        /// <param name="sizey"></param>
        /// <param name="discTexture"></param>
        /// <param name="backgroundTexture"></param>
        /// <param name="cameraTilt"></param>
        /// <param name="trace">If true, the steps of RungeKutta integration will be stored in a list, so that they can be studied after.</param>
        public RayTracer(KerrBlackHoleEquation equation, int sizex, int sizey, Bitmap discTexture, Bitmap backgroundTexture, double cameraTilt, double cameraYaw, bool trace = false)
        {
            this.equation          = equation;
            this.sizex             = sizex;
            this.sizey             = sizey;
            this.discTexture       = discTexture;
            this.backgroundTexture = backgroundTexture;
            this.cameraTilt        = cameraTilt;
            this.trace             = trace;
            this.cameraYaw         = cameraYaw;

            lock (backgroundTexture)
            {
                this.backgroundMap = new SphericalMapping(backgroundTexture.Width, backgroundTexture.Height);
            }

            lock (discTexture)
            {
                this.discMap = new DiscMapping(equation.Rmstable, equation.Rdisk, discTexture.Width, discTexture.Height);
            }

            if (trace)
            {
                this.RayPoints = new List <Tuple <double, double, double> >();
            }
        }