Isosurface.Sampler.ReadData C# (CSharp) Method

ReadData() public static method

public static ReadData ( RawModel m, int res ) : void
m RawModel
res int
return void
        public static void ReadData(RawModel m, int res)
        {
            int highest = Math.Max(Math.Max(m.Width, m.Height), m.Length);
            highest = (int)Math.Pow(2, Math.Ceiling(Math.Log(highest, 2)));
            ReadData("C:\\" + m.Filename + (!m.Mrc ? ".raw" : ""), m.Width, m.Height, m.Length, m.IsoLevel, (float)highest / (float)res, m.Flip, m.Bytes);
        }

Same methods

Sampler::ReadData ( string location, int width, int height, int length, float isolevel, float scale = 1.0f, bool flip = true, int bytes = 1 ) : void

Usage Example

コード例 #1
0
ファイル: Game1.cs プロジェクト: z80/prototyping
        protected override void Initialize()
        {
            AdvancingFrontVIS2006.AdvancingFrontVIS2006.GetIdealEdgeLength(0, (Resolution / 2 - 2), 0);

            //DualMarchingSquaresNeilson.MarchingSquaresTableGenerator.PrintCaseTable();

            ModelIndex = -1;
            if (ModelIndex > -1)
            {
                Sampler.ReadData(Models[ModelIndex], Resolution);
            }

            float n = SimplexNoise.Noise(0, 0);

            RState          = new RasterizerState();
            RState.CullMode = (Sampler.ImageData != null ? CullMode.CullCounterClockwiseFace : CullMode.CullClockwiseFace);
            GraphicsDevice.RasterizerState     = RState;
            graphics.PreferredBackBufferWidth  = 1600;
            graphics.PreferredBackBufferHeight = 900;
            graphics.PreferMultiSampling       = true;
            graphics.ApplyChanges();

            IsMouseVisible = true;

            //effect = new BasicEffect(GraphicsDevice);
            reg_effect = Content.Load <Effect>("ShaderRegular");
            reg_effect.Parameters["ColorEnabled"].SetValue(true);
            dn_effect = Content.Load <Effect>("ShaderDN");
            dn_effect.Parameters["ColorEnabled"].SetValue(true);
            wire_effect = Content.Load <Effect>("WireShader");


            QualityIndex = 0;
            NextAlgorithm();

            //effect.VertexColorEnabled = true;

            Camera            = new Camera(GraphicsDevice, new Vector3(-Resolution, Resolution, -Resolution), 1f);
            Camera.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45), (float)graphics.PreferredBackBufferWidth / (float)graphics.PreferredBackBufferHeight, 0.1f, 1000.0f);
            if (SelectedAlgorithm.Is3D)
            {
                Camera.Update(true);
                //effect.View = Camera.View;
                reg_effect.Parameters["View"].SetValue(Camera.View);
                reg_effect.Parameters["Projection"].SetValue(Camera.Projection);
                dn_effect.Parameters["View"].SetValue(Camera.View);
                dn_effect.Parameters["Projection"].SetValue(Camera.Projection);
            }
            last_state = Keyboard.GetState();

            DrawMode      = Isosurface.DrawModes.Mesh;
            WireframeMode = WireframeModes.Fill;

            base.Initialize();
        }
All Usage Examples Of Isosurface.Sampler::ReadData